28 lines
1.1 KiB
Bash
28 lines
1.1 KiB
Bash
#!/bin/sh
|
|
CONFILE=conf/radius/radius.conf
|
|
DST=${RPM_INSTALL_PREFIX}
|
|
mkdir -p ${DST}/plug/business/
|
|
touch ${DST}/plug/conflist.inf
|
|
mkdir -p ${DST}/conf/
|
|
touch ${DST}/${CONFILE}
|
|
|
|
if [[ -z `grep -rn '\[business\]' ${DST}/plug/conflist.inf` ]];then
|
|
echo '[business]' >> ${DST}/plug/conflist.inf
|
|
fi
|
|
|
|
if [[ -z `grep -rn 'ntc_radius_plug.inf' ${DST}/plug/conflist.inf` ]];then
|
|
sed -i '/\[business\]/a\./plug/business/ntc_radius_plug/ntc_radius_plug.inf' ${DST}/plug/conflist.inf
|
|
fi
|
|
|
|
if [[ -z `grep -rn '\[RADIUS_PLUG\]' ${DST}/${CONFILE}` ]];then
|
|
sed -i '1i\\[RADIUS_PLUG\]' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\LOG_LEVEL=30' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\LOG_PATH=./log/ntc_radius_plug/ntc_radius_plug' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\NIC_NAME=lo' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\SERVICE_ID=162' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\COLLECT_TOPIC=RADIUS-RECORD-LOG' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\BROKERLIST=127.0.0.1:9092' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\DEVICE_ID=0' ${DST}/${CONFILE}
|
|
sed -i '/\[RADIUS_PLUG\]/a\PACKET_TYPE_FLAG=16' ${DST}/${CONFILE}
|
|
fi
|