luci-app-openvpn: use initscript to stop instances
authorMartin Schiller <ms@dev.tdt.de>
Tue, 19 Dec 2017 08:53:19 +0000 (09:53 +0100)
committerMartin Schiller <ms@dev.tdt.de>
Thu, 15 Feb 2018 05:14:24 +0000 (06:14 +0100)
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua

index 719145b887bd8a1b10f776cae7a54e4175d6ca7c..6433229f690e1099191f2427f78e92d0eab9787f 100644 (file)
@@ -103,10 +103,7 @@ function updown.cfgvalue(self, section)
 end
 function updown.write(self, section, value)
        if self.option == "stop" then
-               local pid = s.getPID(section)
-               if pid ~= nil then
-                       sys.process.signal(pid,15)
-               end
+               luci.sys.call("/etc/init.d/openvpn stop %s" % section)
        else
                luci.sys.call("/etc/init.d/openvpn start %s" % section)
        end