diff options
author | Jim P <jim@pingle.org> | 2012-01-23 12:47:22 -0800 |
---|---|---|
committer | Jim P <jim@pingle.org> | 2012-01-23 12:47:22 -0800 |
commit | c2d8c847b872cc0573e9593f81b7c6d4f1f4c75b (patch) | |
tree | c3044e48b9b31370834c25f7582ee96b46932d81 /config/lcdproc-dev/lcdproc_client.php | |
parent | 21bccd9bd78f4d1052693972959cae7c51f78e3d (diff) | |
parent | cc5e67b87b3acda63156bcd135699445a84fadfb (diff) | |
download | pfsense-packages-c2d8c847b872cc0573e9593f81b7c6d4f1f4c75b.tar.gz pfsense-packages-c2d8c847b872cc0573e9593f81b7c6d4f1f4c75b.tar.bz2 pfsense-packages-c2d8c847b872cc0573e9593f81b7c6d4f1f4c75b.zip |
Merge pull request #204 from mdima/master
Some changes / requests from the forum
Diffstat (limited to 'config/lcdproc-dev/lcdproc_client.php')
-rw-r--r-- | config/lcdproc-dev/lcdproc_client.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/config/lcdproc-dev/lcdproc_client.php b/config/lcdproc-dev/lcdproc_client.php index be7efa3f..d931b9d0 100644 --- a/config/lcdproc-dev/lcdproc_client.php +++ b/config/lcdproc-dev/lcdproc_client.php @@ -2,7 +2,7 @@ /* $Id$ */ /* lcdproc_client.php - Copyright (C) 2007 Seth Mos <seth.mos@dds.nl> + Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -97,13 +97,14 @@ function get_uptime_stats() { exec("/usr/bin/uptime", $output, $ret); + $temp = explode(",", $output[0]); if(stristr($output[0], "day")) { - $temp = explode(" ", $output[0]); - $status = "$temp[2] $temp[3] $temp[4] $temp[5] $temp[6] $temp[7] ". substr($temp[8], 0, -1); + $status = "$temp[0] $temp[1]"; } else { - $temp = explode(" ", $output[0]); - $status = "$temp[2] $temp[3] $temp[4] $temp[5] $temp[6] ". substr($temp[7], 0, -1); + $status = "$temp[0] "; } + $status = trim(str_replace(" ", " ", $status)); + $status = substr($status, strpos($status, "up ") + 3); return($status); } @@ -892,4 +893,4 @@ /* loop exited? Close fd and wait for the script to kick in again */ fclose($lcd); } -?> +?>
\ No newline at end of file |