lede icon indicating copy to clipboard operation
lede copied to clipboard

openvpn 启动项仍然有问题

Open honnbin opened this issue 9 years ago • 1 comments

if pid == "" then start = t:option(Button, "_start", translate("Start")) start.inputstyle = "apply" function start.write(self, section) luci.util.exec("uci set openvpn.myvpn.enabled=='1' && uci commit openvpn") message = luci.util.exec("/etc/init.d/openvpn start 2>&1") luci.util.exec("/etc/init.d/openvpn enable") luci.util.exec("sleep 2") luci.http.redirect( luci.dispatcher.build_url("admin", "vpn", "openvpn-server") .. "?message=" .. message ) end else stop = t:option(Button, "_stop", translate("Stop")) stop.inputstyle = "reset" function stop.write(self, section) luci.util.exec("uci set openvpn.myvpn.enabled=='0' && uci commit openvpn") luci.util.exec("/etc/init.d/openvpn stop") luci.util.exec("/etc/init.d/openvpn disable") luci.util.exec("sleep 2") luci.http.redirect( luci.dispatcher.build_url("admin", "vpn", "openvpn-server") ) end end

编译后的文件已经有 luci.util.exec("/etc/init.d/openvpn enable")和luci.util.exec("/etc/init.d/openvpn disable"),但是实际测试没有什么效果,并没有被执行,启动项仍需要手动去开启或关闭

honnbin avatar Sep 21 '17 01:09 honnbin

已修复

coolsnowwolf avatar Sep 22 '17 02:09 coolsnowwolf