aboutsummaryrefslogtreecommitdiffstats
path: root/libs/system.php
diff options
context:
space:
mode:
authorNicolas LLOBERA <nllobera@gmail.com>2017-03-20 19:11:09 +0100
committerNicolas LLOBERA <nllobera@gmail.com>2017-03-20 19:11:09 +0100
commit980b9f75b6c43b191ea0c62f733b6292a9dd11ec (patch)
tree552d53811c62002d9ae3f0cf3a890d2c88bf27a5 /libs/system.php
parentd5b01fd63d60ebd29680c002331262ff72601cbb (diff)
parentf82dab49443f83fc9445297037cd15d85b229f60 (diff)
Merge branch 'master' of https://github.com/shevabam/ezservermonitor-web
Diffstat (limited to 'libs/system.php')
-rw-r--r--libs/system.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/system.php b/libs/system.php
index 702ef3b..ee43722 100644
--- a/libs/system.php
+++ b/libs/system.php
@@ -6,11 +6,11 @@ date_default_timezone_set(@date_default_timezone_get());
$hostname = php_uname('n');
// OS
-if (!($os = shell_exec('/usr/bin/lsb_release -ds | cut -d= -f2 | tr -d \'"\'')))
+if (!file_exists('/usr/bin/lsb_release') || !($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 (!file_exists('/etc/system-release') || !($os = shell_exec('cat /etc/system-release | cut -d= -f2 | tr -d \'"\'')))
{
- if (!($os = shell_exec('cat /etc/os-release | grep PRETTY_NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
+ if (!file_exists('/etc/os-release') || !($os = shell_exec('cat /etc/os-release | grep PRETTY_NAME | tail -n 1 | 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 \'"\'')))
{
@@ -72,4 +72,4 @@ $datas = array(
'server_date' => $server_date,
);
-echo json_encode($datas); \ No newline at end of file
+echo json_encode($datas);