0)
$pid = trim($pid[0]);
else
$pid = "";
return array($pid, $status);
// $status = 0 if connected, 1 if connecting, 2 if not connected
}
$res = get_status();
$pid = $res[0];
$status = $res[1];
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "disconnect" && $pid != "" && ($status == 0 || $status == 1)) {
// stop it
exec("sudo -H /usr/sbin/rapid-tunneling-status -s");
$res = get_status();
$pid = $res[0];
$status = $res[1];
}
if ($status == 0)
$netstat = "Connected";
elseif ($status == 1)
$netstat = "Connecting";
else
$netstat = "Not connected";
echo "Connection status:
\n";
echo date("r") . " $netstat
\n";
if ($status == 0 || $status == 1) {
echo "
";
echo "";
}
?>