diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2008-02-22 07:42:24 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2008-02-22 07:42:24 +0000 |
commit | 0bba9ec1f3e49f1879015401a7fc46c1afe33de6 (patch) | |
tree | cd26e31a22bcb4b168d404c540953be00d45953c /packages/lcdproc/lcdproc_client.php | |
parent | 35537a33fd3c61dec6a65eb462e009c18443982a (diff) | |
download | pfsense-packages-0bba9ec1f3e49f1879015401a7fc46c1afe33de6.tar.gz pfsense-packages-0bba9ec1f3e49f1879015401a7fc46c1afe33de6.tar.bz2 pfsense-packages-0bba9ec1f3e49f1879015401a7fc46c1afe33de6.zip |
Bump version
Fix stray newline. Newlines in text strings sent to LCDd are not
understood and generate errors.
Diffstat (limited to 'packages/lcdproc/lcdproc_client.php')
-rw-r--r-- | packages/lcdproc/lcdproc_client.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/lcdproc/lcdproc_client.php b/packages/lcdproc/lcdproc_client.php index 618a2ab0..ffa81172 100644 --- a/packages/lcdproc/lcdproc_client.php +++ b/packages/lcdproc/lcdproc_client.php @@ -77,7 +77,7 @@ } else { $ip = "-"; } - $ifstatus[] = htmlspecialchars($ifname) ." $online"; + $ifstatus[] = htmlspecialchars($ifname) ." [$online]"; } $status = " ". implode(", ", $ifstatus); return($status); @@ -116,11 +116,11 @@ $svr = split("\|", $server); $monitorip = $svr[1]; if(stristr($poolstatus, $monitorip)) { - $online = "Online"; + $online = "Up"; } else { - $online = "Offline"; + $online = "Down"; } - $pstatus[] = "[{$svr[0]}] {$online}"; + $pstatus[] = strtoupper($svr[0]) ." [{$online}]"; } } else { $pstatus[] = "{$vipent['monitor']}"; @@ -301,7 +301,7 @@ lcdproc_warn("Connection to LCDd process lost $errstr ($errno)"); die(); } - $cmd_output = fgets($lcd, 4096); + $cmd_output = fgets($lcd, 256); // FIXME: add support for interpreting menu commands here. if(preg_match("/^huh?/", $cmd_output)) { lcdproc_notice("LCDd output: \"$cmd_output\". Executed \"$lcd_cmd\""); @@ -420,12 +420,13 @@ $g['product_name'] = "pfSense"; } $version = @file_get_contents("/etc/version"); + $version = trim($version); /* keep a counter to see how many times we can loop */ $i = 1; while($i) { $lcd_cmds = array(); $lcd_cmds[] = "widget_set welcome_scr title_wdgt \"Welcome to\""; - $lcd_cmds[] = "widget_set welcome_scr text_wdgt 1 2 16 2 h 2 \"{$g['product_name']} $version\""; + $lcd_cmds[] = "widget_set welcome_scr text_wdgt 1 2 16 2 h 2 \"{$g['product_name']} {$version}\""; /* process screens to display */ foreach((array) $lcdproc_screens_config as $name => $screen) { |