summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-04-13 14:45:02 +0200
committerJo-Philipp Wich <jo@mein.io>2018-04-13 14:45:28 +0200
commit9f327a3d020c9bd03c3a4a005c4de87353a0c354 (patch)
tree5e371e8ba440951a0d18d6a076dfca5486ea971b
parentd4886818ce420d30c0ad11e30ea91daf95195f93 (diff)
luci-app-openvpn: properly parse low PIDs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
index 52ba9e3f29..d2b5d32c05 100644
--- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
+++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
@@ -28,7 +28,7 @@ uci:foreach( "openvpn_recipes", "openvpn_recipe",
function s.getPID(section) -- Universal function which returns valid pid # or nil
local pid = sys.exec("%s | grep -w '[o]penvpn(%s)'" % { psstring, section })
if pid and #pid > 0 then
- return tonumber(pid:match("^%d+"))
+ return tonumber(pid:match("^%s*(%d+)"))
else
return nil
end