From 7ea30d60503a5511f8b9f04171e74a0e8dd4cf8f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 3 Feb 2014 11:23:28 -0200 Subject: Use php function to get hostname instead of exec() --- etc/inc/ipsec.auth-user.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'etc') diff --git a/etc/inc/ipsec.auth-user.php b/etc/inc/ipsec.auth-user.php index 97ec0e3..1f93e09 100755 --- a/etc/inc/ipsec.auth-user.php +++ b/etc/inc/ipsec.auth-user.php @@ -56,11 +56,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; } } -- cgit v1.1