summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/openvpn.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc/inc/openvpn.inc')
-rw-r--r--src/etc/inc/openvpn.inc36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/etc/inc/openvpn.inc b/src/etc/inc/openvpn.inc
index 945e7ff..c163294 100644
--- a/src/etc/inc/openvpn.inc
+++ b/src/etc/inc/openvpn.inc
@@ -526,7 +526,7 @@ function openvpn_reconfigure($mode, $settings) {
// Otherwise, if a specific interface is requested, use it
// If "any" interface was selected, local directive will be omitted.
if (is_ipaddrv4($ipaddr)) {
- $iface_ip=$ipaddr;
+ $iface_ip = $ipaddr;
} else {
if ((!empty($interface)) && (strcmp($interface, "any"))) {
$iface_ip=get_interface_ip($interface);
@@ -793,12 +793,12 @@ function openvpn_reconfigure($mode, $settings) {
$up_file = "{$g['varetc_path']}/openvpn/{$mode_id}.up";
$conf .= "auth-user-pass {$up_file}\n";
if ($settings['auth_user']) {
- $userpass = "{$settings['auth_user']}\n";
+ $userpass = "{$settings['auth_user']}\n";
} else {
$userpass = "";
}
if ($settings['auth_pass']) {
- $userpass .= "{$settings['auth_pass']}\n";
+ $userpass .= "{$settings['auth_pass']}\n";
}
// If only auth_pass is given, then it acts like a user name and we put a blank line where pass would normally go.
if (!($settings['auth_user'] && $settings['auth_pass'])) {
@@ -1351,29 +1351,29 @@ function openvpn_get_client_status($client, $socket) {
}
/* Get the client state */
- if (strstr($line,"CONNECTED")) {
- $client['status']="up";
+ if (strstr($line, "CONNECTED")) {
+ $client['status'] = "up";
$list = explode(",", $line);
- $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
- $client['virtual_addr'] = $list[3];
+ $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
+ $client['virtual_addr'] = $list[3];
$client['remote_host'] = $list[4];
}
- if (strstr($line,"CONNECTING")) {
- $client['status']="connecting";
+ if (strstr($line, "CONNECTING")) {
+ $client['status'] = "connecting";
}
- if (strstr($line,"ASSIGN_IP")) {
- $client['status']="waiting";
+ if (strstr($line, "ASSIGN_IP")) {
+ $client['status'] = "waiting";
$list = explode(",", $line);
- $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
- $client['virtual_addr'] = $list[3];
+ $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
+ $client['virtual_addr'] = $list[3];
}
- if (strstr($line,"RECONNECTING")) {
- $client['status']="reconnecting";
+ if (strstr($line, "RECONNECTING")) {
+ $client['status'] = "reconnecting";
$list = explode(",", $line);
- $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
+ $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
$client['status'] .= "; " . $list[2];
}
/* parse end of output line */
@@ -1395,12 +1395,12 @@ function openvpn_get_client_status($client, $socket) {
break;
}
- if (strstr($line,"TCP/UDP read bytes")) {
+ if (strstr($line, "TCP/UDP read bytes")) {
$list = explode(",", $line);
$client['bytes_recv'] = $list[1];
}
- if (strstr($line,"TCP/UDP write bytes")) {
+ if (strstr($line, "TCP/UDP write bytes")) {
$list = explode(",", $line);
$client['bytes_sent'] = $list[1];
}
OpenPOWER on IntegriCloud