diff --git a/etc/inc/openvpn.auth-user.php b/etc/inc/openvpn.auth-user.php index 2ddadca5fe..326f788727 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; } }