diff options
author | Hugues Granger <hugues.granger@gmail.com> | 2014-10-26 15:01:34 +0100 |
---|---|---|
committer | Hugues Granger <hugues.granger@gmail.com> | 2014-10-26 15:01:34 +0100 |
commit | b28e0b02756c4d5b84ca9040f04ef6c90fbf00db (patch) | |
tree | a9caec76c67703f189efcfd79ea442841928ed49 | |
parent | d868a423edb4695acc92f7908d294c46500b89c0 (diff) |
Fix distro name for some more platforms (e.g. Raspbian).
-rw-r--r-- | libs/system.php | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/libs/system.php b/libs/system.php index b814432..1b0482e 100644 --- a/libs/system.php +++ b/libs/system.php @@ -7,21 +7,9 @@ $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('find /etc/*-release -type f -exec cat {} \; | grep NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\''))) { - if (!($os = shell_exec('cat /etc/redhat-release'))) - { - 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'; } } |