diff options
author | ShevAbam <shevabam@gmail.com> | 2015-02-11 21:20:02 +0100 |
---|---|---|
committer | ShevAbam <shevabam@gmail.com> | 2015-02-11 21:20:02 +0100 |
commit | efbbfedeab7a2ace0f42f0e4fd914e8e437291d4 (patch) | |
tree | dad3df9e2edd88584d561e270d761d7b063cad72 /libs/system.php | |
parent | 086a1829e65a8c148b1f5c4aa6251a29bead3ea6 (diff) |
Fix on retrieving OS name
Diffstat (limited to 'libs/system.php')
-rw-r--r-- | libs/system.php | 5 |
1 files changed, 3 insertions, 2 deletions
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'))) |