mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Remove connect delay, strip ANSI sequences from connect output
This commit is contained in:
parent
601f587cb0
commit
bc03b329ca
@ -60,10 +60,13 @@ function DisplayProviderConfig()
|
|||||||
$status->addMessage('Attempting to connect VPN provider', 'info');
|
$status->addMessage('Attempting to connect VPN provider', 'info');
|
||||||
$cmd = getCliOverride($id, 'cmd_overrides', 'connect');
|
$cmd = getCliOverride($id, 'cmd_overrides', 'connect');
|
||||||
exec("sudo $binPath $cmd", $return);
|
exec("sudo $binPath $cmd", $return);
|
||||||
sleep(3); // required for connect delay
|
|
||||||
$return = stripArtifacts($return);
|
$return = stripArtifacts($return);
|
||||||
foreach ($return as $line) {
|
foreach ($return as $line) {
|
||||||
$status->addMessage($line, 'info');
|
if (strlen(trim($line)) > 0) {
|
||||||
|
$line = preg_replace('/\e\[\?[0-9]*l\s(.*)\e.*$/', '$1', $line);
|
||||||
|
$line = preg_replace('/\e\[0m\e\[[0-9;]*m(.*)/', '$1', $line);
|
||||||
|
$status->addMessage($line, 'info');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} elseif (isset($_POST['StopProviderVPN'])) {
|
} elseif (isset($_POST['StopProviderVPN'])) {
|
||||||
$status->addMessage('Attempting to disconnect VPN provider', 'info');
|
$status->addMessage('Attempting to disconnect VPN provider', 'info');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user