summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShevAbam <shevabam@gmail.com>2016-04-19 18:01:40 +0200
committerShevAbam <shevabam@gmail.com>2016-04-19 18:01:40 +0200
commitb6d98b7f12b2e484f3c2728a69ae99c759582f82 (patch)
tree272e84704989097ef4422b72d1f83b0bba0f92b2
parent4952f02a7ae23160e4a18eb7fa5feea1f499bc19 (diff)
System : better OS name detectionmaster
-rw-r--r--libs/system.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/system.php b/libs/system.php
index 5aea939..702ef3b 100644
--- a/libs/system.php
+++ b/libs/system.php
@@ -8,11 +8,14 @@ $hostname = php_uname('n');
// OS
if (!($os = shell_exec('/usr/bin/lsb_release -ds | cut -d= -f2 | tr -d \'"\'')))
{
- if(!($os = shell_exec('cat /etc/system-release | cut -d= -f2 | tr -d \'"\'')))
+ 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 PRETTY_NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
+ if (!($os = shell_exec('cat /etc/os-release | grep PRETTY_NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
{
- $os = 'N.A';
+ if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep PRETTY_NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
+ {
+ $os = 'N.A';
+ }
}
}
}