diff --git a/dc1svr/build.sh b/dc1svr/build.sh index f60e83d..ede42f5 100755 --- a/dc1svr/build.sh +++ b/dc1svr/build.sh @@ -2,7 +2,7 @@ MODULE=dc1svr -VERSION=1.0 +VERSION=1.1 TITLE=dc1服务器 DESCRIPTION=dc1服务器 HOME_URL=Module_dc1svr.asp diff --git a/dc1svr/config.json.js b/dc1svr/config.json.js index 8bcca56..cad67bd 100644 --- a/dc1svr/config.json.js +++ b/dc1svr/config.json.js @@ -1,8 +1,8 @@ { -"version":"1.0", -"md5":"f68ae16aeda08671d0210772cdc6c218", +"version":"1.1", +"md5":"a473adbb2ba5e7d36ab8d68050a93ea6", "home_url":"Module_dc1svr.asp", "title":"dc1服务器", "description":"dc1服务器", -"build_date":"2019-02-12_19:53:36" +"build_date":"2019-02-20_23:06:16" } diff --git a/dc1svr/dc1svr.tar.gz b/dc1svr/dc1svr.tar.gz index c2fa448..fb481d3 100644 Binary files a/dc1svr/dc1svr.tar.gz and b/dc1svr/dc1svr.tar.gz differ diff --git a/dc1svr/dc1svr/bin/dc1svr b/dc1svr/dc1svr/bin/dc1svr index f6b8a7b..af63a47 100755 Binary files a/dc1svr/dc1svr/bin/dc1svr and b/dc1svr/dc1svr/bin/dc1svr differ diff --git a/dc1svr/dc1svr/install.sh b/dc1svr/dc1svr/install.sh index 1173a33..78a46fa 100644 --- a/dc1svr/dc1svr/install.sh +++ b/dc1svr/dc1svr/install.sh @@ -18,7 +18,7 @@ rm -rf /tmp/dc1svr* >/dev/null 2>&1 chmod a+x /jffs/softcenter/scripts/dc1.sh chmod 0755 /jffs/softcenter/bin/dc1svr -dbus set dc1svr_version="1.0" +dbus set dc1svr_version="1.1" dbus set softcenter_module_dc1svr_version="1.0" dbus set softcenter_module_dc1svr_description="dc1服务器" dbus set softcenter_module_dc1svr_install=1 diff --git a/dc1svr/dc1svr/scripts/dc1svr.sh b/dc1svr/dc1svr/scripts/dc1svr.sh index 6c8ffc2..54cbaf4 100644 --- a/dc1svr/dc1svr/scripts/dc1svr.sh +++ b/dc1svr/dc1svr/scripts/dc1svr.sh @@ -4,7 +4,32 @@ eval `dbus export dc1svr` source /jffs/softcenter/scripts/base.sh CONFIG_FILE=/tmp/etc/dnsmasq.user/dc1.conf +dc_mon(){ + echo "#!/bin/sh" > /tmp/dc_mon.sh + echo "while [ \"1\" = \"1\" ]" >> /tmp/dc_mon.sh + echo "do" >> /tmp/dc_mon.sh + echo " sleep 120s" >> /tmp/dc_mon.sh + echo " idc=`ps -w|grep dc1svr |grep -v grep |wc -l`" >> /tmp/dc_mon.sh + echo " if [ $idc = 0 ] ;then" >> /tmp/dc_mon.sh + echo " /jffs/softcenter/scripts/dc1svr.sh" >> /tmp/dc_mon.sh + echo " fi" >> /tmp/dc_mon.sh + echo "done" >> /tmp/dc_mon.sh + /tmp/dc_mon.sh & +} + start_dc1(){ + killall dc1svr >/dev/null 2>&1 + if [ -e "/jffs/softcenter/bin/KEY" ]; then + [ "$(cat /jffs/softcenter/bin/KEY)" != "$dc1svr_key" ] && echo "$dc1svr_key" > /jffs/softcenter/bin/KEY + else + if [ "$dc1svr_key" = "0" ]; then + key=`nvram get http_passwd` + echo "$key" > /jffs/softcenter/bin/KEY + dbus set dc1svr_key=$key + else + echo "$dc1svr_key" > /jffs/softcenter/bin/KEY + fi + fi cd /jffs/softcenter/bin/ /jffs/softcenter/bin/dc1svr & echo "address=/Smartplugconnect.phicomm.com/$(nvram get lan_ipaddr)" > $CONFIG_FILE @@ -13,6 +38,7 @@ start_dc1(){ if [ ! -e "/jffs/softcenter/init.d/S97dc1svr.sh" ]; then cp -f /jffs/softcenter/scripts/dc1svr.sh /jffs/softcenter/init.d/S97dc1svr.sh fi + [ $(ps -w|grep 'dc_mon.sh' |grep -v grep |wc -l) = 0 ] && dc_mon } stop_dc1(){ killall dc1svr diff --git a/dc1svr/dc1svr/webs/Module_dc1svr.asp b/dc1svr/dc1svr/webs/Module_dc1svr.asp index 14d866d..1be2f5e 100644 --- a/dc1svr/dc1svr/webs/Module_dc1svr.asp +++ b/dc1svr/dc1svr/webs/Module_dc1svr.asp @@ -100,6 +100,7 @@ "/> "/> +
@@ -151,6 +152,12 @@ [ 更新日志 ] | |
连接密码 | ++ + | +
---|
默认密码为路由器密码
+启用本插件后必需把排插断电重启一次
+