Improve active VPN detection

This commit is contained in:
Christian Zeitnitz 2021-07-26 15:42:14 +02:00
parent 882535b130
commit 0886999055
1 changed files with 2 additions and 2 deletions

View File

@ -142,10 +142,10 @@ function ReadFirewallConf() {
$conf["client-device"] = "";
$conf["restricted-ips"] = "";
}
exec('ifconfig | grep -E -i "tun+"', $ret);
exec('ifconfig | grep -E -i "^tun[0-9]"', $ret);
$conf["openvpn-enable"] = !empty($ret);
unset($ret);
exec('ifconfig | grep -E -i "wg+"', $ret);
exec('ifconfig | grep -E -i "^wg[0-9]"', $ret);
$conf["wireguard-enable"] = !empty($ret);
return $conf;
}