aboutsummaryrefslogtreecommitdiffstats
path: root/config/lcdproc-dev
diff options
context:
space:
mode:
Diffstat (limited to 'config/lcdproc-dev')
-rw-r--r--config/lcdproc-dev/lcdproc.inc71
-rw-r--r--config/lcdproc-dev/lcdproc.xml2
-rw-r--r--config/lcdproc-dev/lcdproc_client.php2
3 files changed, 18 insertions, 57 deletions
diff --git a/config/lcdproc-dev/lcdproc.inc b/config/lcdproc-dev/lcdproc.inc
index 6c245058..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,17 +458,18 @@
}
/* generate rc file start and stop */
$stop = <<<EOD
-if [ `ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'| wc -l` != 0 ]; then
- ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'|xargs /bin/kill
- sleep 1
+if [ `pgrep -f lcdproc_client.ph` ];then
+ pkill -f lcdproc_client.ph
+ sleep 1
fi
-if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0 ]; then
- ps auxw |awk '/LCD[d]/ {print $2}'|xargs /bin/kill
+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/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();
diff --git a/config/lcdproc-dev/lcdproc.xml b/config/lcdproc-dev/lcdproc.xml
index 7b59bce0..7c0cd318 100644
--- a/config/lcdproc-dev/lcdproc.xml
+++ b/config/lcdproc-dev/lcdproc.xml
@@ -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 6050b6ca..22713b98 100644
--- a/config/lcdproc-dev/lcdproc_client.php
+++ b/config/lcdproc-dev/lcdproc_client.php
@@ -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);