diff --git a/app/system/resources/dashboard/system_status.php b/app/system/resources/dashboard/system_status.php index abe5e483c3..e32e77290c 100644 --- a/app/system/resources/dashboard/system_status.php +++ b/app/system/resources/dashboard/system_status.php @@ -111,19 +111,9 @@ //os uptime if (stristr(PHP_OS, 'Linux')) { - unset($tmp); - $cut = shell_exec("/usr/bin/which cut"); - $uptime = trim(shell_exec(escapeshellcmd($cut." -d. -f1 /proc/uptime"))); - $tmp['y'] = floor($uptime/60/60/24/365); - $tmp['d'] = intdiv(intdiv(intdiv($uptime,60),60),24)%365; - $tmp['h'] = intdiv(intdiv($uptime,60),60)%24; - $tmp['m'] = intdiv($uptime,60)%60; - $tmp['s'] = $uptime%60; - $uptime = (($tmp['y'] != 0 && $tmp['y'] != '') ? $tmp['y'].'y ' : null); - $uptime .= (($tmp['d'] != 0 && $tmp['d'] != '') ? $tmp['d'].'d ' : null); - $uptime .= (($tmp['h'] != 0 && $tmp['h'] != '') ? $tmp['h'].'h ' : null); - $uptime .= (($tmp['m'] != 0 && $tmp['m'] != '') ? $tmp['m'].'m ' : null); - $uptime .= (($tmp['s'] != 0 && $tmp['s'] != '') ? $tmp['s'].'s' : null); + $prefix = 'up '; + $linux_uptime = shell_exec('uptime -p'); + $uptime = substr($linux_uptime, strlen($prefix)); if ($uptime != '') { echo "\n"; echo "".$text['label-system_uptime']."\n"; @@ -232,4 +222,4 @@ echo ""; echo "\n"; -?> \ No newline at end of file +?>