summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/inc/openvpn.auth-user.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/openvpn.auth-user.php b/etc/inc/openvpn.auth-user.php
index 5c8c09b..dc12992 100755
--- a/etc/inc/openvpn.auth-user.php
+++ b/etc/inc/openvpn.auth-user.php
@@ -57,11 +57,10 @@ function getNasID()
{
global $g;
- $nasId = "";
- exec("/bin/hostname", $nasId);
- if(!$nasId[0])
- $nasId[0] = "{$g['product_name']}";
- return $nasId[0];
+ $nasId = gethostname();
+ if(empty($nasId))
+ $nasId = $g['product_name'];
+ return $nasId;
}
}
OpenPOWER on IntegriCloud