luci-app-openvpn: properly parse low PIDs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
d4886818ce
commit
9f327a3d02
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue