From efbbfedeab7a2ace0f42f0e4fd914e8e437291d4 Mon Sep 17 00:00:00 2001 From: ShevAbam Date: Wed, 11 Feb 2015 21:20:02 +0100 Subject: Fix on retrieving OS name --- libs/system.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libs/system.php') diff --git a/libs/system.php b/libs/system.php index 7e40e3b..f569d30 100644 --- a/libs/system.php +++ b/libs/system.php @@ -5,9 +5,9 @@ require 'Utils/Misc.class.php'; $hostname = php_uname('n'); // OS -if (!($os = shell_exec('/usr/bin/lsb_release -ds'))) +if (!($os = shell_exec('/usr/bin/lsb_release -ds | cut -d= -f2 | tr -d \'"\''))) { - if(!($os = shell_exec('cat /etc/system-release'))) + if(!($os = shell_exec('cat /etc/system-release | cut -d= -f2 | tr -d \'"\''))) { if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\''))) { @@ -16,6 +16,7 @@ if (!($os = shell_exec('/usr/bin/lsb_release -ds'))) } } $os = trim($os, '"'); +$os = str_replace("\n", '', $os); // Kernel if (!($kernel = shell_exec('/bin/uname -r'))) -- cgit v1.2.3