diff --git a/preinstall/install.sh b/preinstall/install.sh index 729c6f8..d1deb82 100644 --- a/preinstall/install.sh +++ b/preinstall/install.sh @@ -6,16 +6,21 @@ 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}/tsgconf/main.conf` ]];then +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=192.168.40.186:9092' ${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} fi diff --git a/src/ntc_radius_plug.cpp b/src/ntc_radius_plug.cpp index 3dc5e78..f0ac373 100644 --- a/src/ntc_radius_plug.cpp +++ b/src/ntc_radius_plug.cpp @@ -336,7 +336,7 @@ int NTC_RADIUS_PLUG_INIT(void) rd_kafka_topic_conf_t *topic_conf; memset(&g_ntc_radius_plug,0,sizeof(g_ntc_radius_plug_t)); - MESA_load_profile_string_def(config_file, "RADIUS_PLUG", "NIC_NAME", nic_name, sizeof(nic_name), "eth0"); + MESA_load_profile_string_def(config_file, "RADIUS_PLUG", "NIC_NAME", nic_name, sizeof(nic_name), "lo"); MESA_load_profile_string_def(config_file, "RADIUS_PLUG","LOG_PATH",g_ntc_radius_plug.pathname, sizeof(g_ntc_radius_plug.pathname), "./log/ntc_radius_plug/ntc_radius_plug"); MESA_load_profile_int_def(config_file, "RADIUS_PLUG", "SERVICE_ID", &g_ntc_radius_plug.service_id, 0xA2); MESA_load_profile_int_def(config_file, "RADIUS_PLUG","LOG_LEVEL", &g_ntc_radius_plug.level, RLOG_LV_FATAL);