From 261d36fc871333cdaffb715d336f7500973f2f87 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Wed, 25 Dec 2019 11:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=20=E8=B0=83=E6=95=B4=E9=A2=84=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- preinstall/install.sh | 9 +++++++-- src/ntc_radius_plug.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) 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);