diff options
author | Michele Di Maria <michele@nt2.it> | 2011-12-18 00:37:06 +0100 |
---|---|---|
committer | Michele Di Maria <michele@nt2.it> | 2011-12-18 00:37:06 +0100 |
commit | db26caf726685e44a8a6fc04e55e2006e2fa4ec5 (patch) | |
tree | f8d9c504a6dfe9b66ce03aa34150d1ea921305f3 | |
parent | 4df6d0b63e07cfe556c1d522e1a59f8223e0aa8d (diff) | |
download | pfsense-packages-db26caf726685e44a8a6fc04e55e2006e2fa4ec5.tar.gz pfsense-packages-db26caf726685e44a8a6fc04e55e2006e2fa4ec5.tar.bz2 pfsense-packages-db26caf726685e44a8a6fc04e55e2006e2fa4ec5.zip |
Stops the service before doing anything to the configuration.
This solves a problem during reinstall and saving the settings while the service is running.
-rw-r--r-- | config/lcdproc-dev/lcdproc.inc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/config/lcdproc-dev/lcdproc.inc b/config/lcdproc-dev/lcdproc.inc index b82a59e6..5d2d9fb1 100644 --- a/config/lcdproc-dev/lcdproc.inc +++ b/config/lcdproc-dev/lcdproc.inc @@ -169,7 +169,9 @@ global $g; global $config; global $input_errors; - + + /* I just stop the package */ + lcdproc_action('stop'); config_lock(); $lcdproc_config = $config['installedpackages']['lcdproc']['config'][0]; @@ -201,6 +203,7 @@ break; default: lcdproc_warn("The selected com port is not valid!"); + config_unlock(); return; } @@ -481,14 +484,14 @@ EOD; /* generate rc file start and stop */ $stop = <<<EOD -if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0 ]; then - ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill - sleep 1 -fi if [ `ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l` != 0 ]; then ps auxw |awk '/lcdclient.s[h]/ {print $2}'|xargs kill sleep 1 fi +if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0 ]; then + ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill + sleep 1 +fi EOD; $start = $stop ."\n"; @@ -507,10 +510,10 @@ EOD; conf_mount_ro(); /* or restart lcdproc if settings were changed */ - if(lcdproc_running($_POST['comport'])) { + if(lcdproc_running()) { lcdproc_notice("Restarting service lcdproc"); lcdproc_action('restart'); - } + } } if((! $lcdproc_config['driver']) || ($lcdproc_config['comport'] == "none")) { |