Commit d0b88095 authored by chenhaowen's avatar chenhaowen

fix up luci apply

parent 17e2d1fb
......@@ -3,8 +3,15 @@
START=99
start() {
remote_ip=$(uci get gdut_drcom.@gdut_drcom[0].remote_ip)
keep_alive1_flag=$(uci get gdut_drcom.@gdut_drcom[0].keep_alive1_flag)
remote_ip=$(uci get gdut_drcom.@gdut_drcom[0].remote_ip 2>/dev/null)
keep_alive1_flag=$(uci get gdut_drcom.@gdut_drcom[0].keep_alive1_flag 2>/dev/null)
enable=$(uci get gdut_drcom.@gdut_drcom[0].enable 2>/dev/null)
if [ "$enable"x = "1"x ]; then
/etc/init.d/gdut-drcom enable
else
/etc/init.d/gdut-drcom disable
return
fi
cmd="service_start /usr/bin/gdut-drcom -c /etc/gdut-drcom.conf "
if [ -n "$remote_ip" ]; then
......@@ -17,8 +24,8 @@ start() {
eval $cmd
}
stop()
{
service_stop /usr/bin/gdut-drcom
return 0
}
......@@ -24,7 +24,7 @@ keep_alive_flag = s:option(Value, "keep_alive1_flag", translate("Keep alive1 fla
local apply = luci.http.formvalue("cbi.apply")
if apply then
io.popen("echo gdut-drcom apply >> /root/gdut-drcom.log")
io.popen("/etc/init.d/gdut-drcom restart")
end
return m
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment