diff options
author | shevabam <shevabam@users.noreply.github.com> | 2014-11-11 15:25:20 +0100 |
---|---|---|
committer | shevabam <shevabam@users.noreply.github.com> | 2014-11-11 15:25:20 +0100 |
commit | e78dc167c2f5cfc2ec92c9d299073b493e6f1c3d (patch) | |
tree | 5c444b5b170ec7484450a5b3a4c950cc336b6727 | |
parent | d868a423edb4695acc92f7908d294c46500b89c0 (diff) | |
parent | 7e44ecbd4710e6eb9409daaded9064180ff9aefd (diff) |
Merge pull request #8 from Wohlraj/distro_name
Fix distro name for some more platforms (e.g. Raspbian).
-rw-r--r-- | libs/system.php | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/libs/system.php b/libs/system.php index b814432..62ca9cc 100644 --- a/libs/system.php +++ b/libs/system.php @@ -7,20 +7,11 @@ $hostname = php_uname('n'); // OS if (!($os = shell_exec('/usr/bin/lsb_release -ds'))) { - if (!($os = shell_exec('cat /etc/fedora-release'))) + if(!($os = shell_exec('cat /etc/system-release'))) { - if (!($os = shell_exec('cat /etc/redhat-release'))) + if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\''))) { - if (!($os = shell_exec('cat /etc/mandriva-release'))) - { - if (!($os = shell_exec('cat /etc/SuSE-release'))) - { - if (!($os = shell_exec('cat /etc/centos-release'))) - { - $os = 'N.A'; - } - } - } + $os = 'N.A'; } } } |