diff options
Diffstat (limited to 'config/lcdproc-dev')
-rw-r--r-- | config/lcdproc-dev/lcdproc.inc | 81 | ||||
-rw-r--r-- | config/lcdproc-dev/lcdproc.xml | 6 | ||||
-rw-r--r-- | config/lcdproc-dev/lcdproc_client.php | 8 | ||||
-rw-r--r-- | config/lcdproc-dev/lcdproc_screens.xml | 2 |
4 files changed, 28 insertions, 69 deletions
diff --git a/config/lcdproc-dev/lcdproc.inc b/config/lcdproc-dev/lcdproc.inc index 4034248d..1436c07d 100644 --- a/config/lcdproc-dev/lcdproc.inc +++ b/config/lcdproc-dev/lcdproc.inc @@ -72,35 +72,15 @@ if($post['comport']) { switch($post['comport']) { case "none": - continue; - break; case "com1": - continue; - break; case "com2": - continue; - break; case "com1a": - continue; - break; case "com2a": - continue; - break; case "ucom1": - continue; - break; case "ucom2": - continue; - break; case "lpt1": - continue; - break; case "ugen0.2": - continue; - break; case "ugen1.2": - continue; - break; case "ugen2.2": continue; break; @@ -112,32 +92,14 @@ if($post['size']) { switch($post['size']) { case "12x1": - continue; - break; case "12x2": - continue; - break; case "12x4": - continue; - break; case "16x1": - continue; - break; case "16x2": - continue; - break; case "16x4": - continue; - break; case "20x1": - continue; - break; case "20x2": - continue; - break; case "20x4": - continue; - break; case "40x2": continue; break; @@ -149,23 +111,11 @@ if($post['port_speed']) { switch($post['port_speed']) { case "0": - continue; - break; case "1200": - continue; - break; case "2400": - continue; - break; case "9600": - continue; - break; case "19200": - continue; - break; case "57600": - continue; - break; case "115200": continue; break; @@ -185,6 +135,14 @@ global $g; global $config; global $input_errors; + + # detect boot process + if (is_array($_POST)){ + if (! preg_match("/\w+/",$_POST['__csrf_magic'])) + return; + } + + #continue sync package lcdproc_notice("Sync: Begin package sync"); config_lock(); $lcdproc_config = $config['installedpackages']['lcdproc']['config'][0]; @@ -500,20 +458,19 @@ } /* generate rc file start and stop */ $stop = <<<EOD -while [ `ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'| wc -l` != 0 ]; -do - ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'|xargs kill - sleep 2 -done -while [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0 ]; -do - ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill - sleep 2 -done +if [ `pgrep -f lcdproc_client.ph` ];then + pkill -f lcdproc_client.ph + sleep 1 +fi +if [ `pgrep -anx LCDd` ]; then + pkill -anx LCDd + sleep 1 +fi + EOD; $start = $stop ."\n"; - $start .= "\t/usr/bin/nice -20 /usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ."\n"; - $start .= "\t/usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php\n"; + $start .= "\t/usr/bin/nice -20 /usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ." -u nobody\n"; + $start .= "\t/usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php &\n"; /* write out the configuration */ conf_mount_rw(); lcdproc_write_config(LCDPROC_CONFIG, $config_text); diff --git a/config/lcdproc-dev/lcdproc.xml b/config/lcdproc-dev/lcdproc.xml index b077250f..7c0cd318 100644 --- a/config/lcdproc-dev/lcdproc.xml +++ b/config/lcdproc-dev/lcdproc.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" ?> <packagegui> - <title>Services: LCDproc 0.5.5 pkg v. 0.9.3</title> + <title>Services: LCDproc 0.5.5 pkg v. 0.9.4</title> <name>lcdproc</name> - <version>0.5.5 pkg v. 0.9.3</version> + <version>0.5.5 pkg v. 0.9.4</version> <savetext>Save</savetext> <include_file>/usr/local/pkg/lcdproc.inc</include_file> <tabs> @@ -431,7 +431,7 @@ </field> <field> <fieldname>offbrightness</fieldname> - <fielddescr>Offrightness</fielddescr> + <fielddescr>Off brightness</fielddescr> <description>Set the off-brightness of the LCD panel. This value is used when the display is normally switched off in case LCDd is inactive. This option is not supported by all the LCD panels, leave "default" if unsure.</description> <type>select</type> <options> diff --git a/config/lcdproc-dev/lcdproc_client.php b/config/lcdproc-dev/lcdproc_client.php index 684a645f..22713b98 100644 --- a/config/lcdproc-dev/lcdproc_client.php +++ b/config/lcdproc-dev/lcdproc_client.php @@ -42,15 +42,15 @@ if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) $maxstates="/{$config['system']['maximumstates']}"; else - $maxstates="/10000"; - + $maxstates="/". pfsense_default_state_size(); + $curentries = `/sbin/pfctl -si |grep current`; if (preg_match("/([0-9]+)/", $curentries, $matches)) { $curentries = $matches[1]; } return $curentries . $maxstates; } - + function disk_usage() { $dfout = ""; exec("/bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1", $dfout); @@ -911,6 +911,8 @@ lcdproc_warn("Failed to connect to LCDd process $errstr ($errno)"); $lcdproc_connect_errors++; } else { + /* Allow the script to run forever (0) */ + set_time_limit(0); build_interface($lcd); loop_status($lcd); fclose($lcd); diff --git a/config/lcdproc-dev/lcdproc_screens.xml b/config/lcdproc-dev/lcdproc_screens.xml index da064e9e..f7c70086 100644 --- a/config/lcdproc-dev/lcdproc_screens.xml +++ b/config/lcdproc-dev/lcdproc_screens.xml @@ -2,7 +2,7 @@ <packagegui> <title>Services: LCDproc: Screens</title> <name>lcdproc_screens</name> - <version>0.5.5 pkg v. 0.9.3</version> + <version>0.5.5 pkg v. 0.9.4</version> <savetext>Save</savetext> <include_file>/usr/local/pkg/lcdproc.inc</include_file> <tabs> |