From 9f327a3d020c9bd03c3a4a005c4de87353a0c354 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 13 Apr 2018 14:45:02 +0200 Subject: [PATCH] luci-app-openvpn: properly parse low PIDs Signed-off-by: Jo-Philipp Wich --- applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua index 52ba9e3f2..d2b5d32c0 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 -- 2.25.1