summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshevabam <shevabam@users.noreply.github.com>2014-11-11 15:25:20 +0100
committershevabam <shevabam@users.noreply.github.com>2014-11-11 15:25:20 +0100
commite78dc167c2f5cfc2ec92c9d299073b493e6f1c3d (patch)
tree5c444b5b170ec7484450a5b3a4c950cc336b6727
parentd868a423edb4695acc92f7908d294c46500b89c0 (diff)
parent7e44ecbd4710e6eb9409daaded9064180ff9aefd (diff)
Merge pull request #8 from Wohlraj/distro_name
Fix distro name for some more platforms (e.g. Raspbian).
-rw-r--r--libs/system.php15
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';
}
}
}