fix openvpn autorun issue

This commit is contained in:
coolsnowwolf 2017-09-21 00:25:24 +08:00
parent 67d4bd2e64
commit 9c78b8dc3b
2 changed files with 3 additions and 1 deletions

View File

@ -10,7 +10,7 @@ LUCI_DEPENDS:=+openvpn-openssl +openvpn-easy-rsa
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-openvpn-server
PKG_VERSION:=2.0
PKG_RELEASE:=13
PKG_RELEASE:=15
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -99,6 +99,7 @@ if pid == "" then
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
@ -110,6 +111,7 @@ else
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")