summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2019-12-06 18:43:40 -0600
committerJohn Klug <john.klug@multitech.com>2019-12-06 18:43:40 -0600
commit80eaa16354f31eba6e684018d9ca85e08ff2f817 (patch)
tree156bc810613136f088a3a2748b290bd2f21b2427
parent9d870ac83b48cb6187fdc784c2e18179f906759a (diff)
downloadcommissioning-80eaa16354f31eba6e684018d9ca85e08ff2f817.tar.gz
commissioning-80eaa16354f31eba6e684018d9ca85e08ff2f817.tar.bz2
commissioning-80eaa16354f31eba6e684018d9ca85e08ff2f817.zip
Set paths consistantly
-rwxr-xr-xetc/init.d/commission4
-rwxr-xr-xetc/init.d/commission-php-fpm5
-rwxr-xr-xusr/libexec/commission/off.sh2
-rw-r--r--www/commission/index.php4
4 files changed, 7 insertions, 8 deletions
diff --git a/etc/init.d/commission b/etc/init.d/commission
index 5241176..c65fbaf 100755
--- a/etc/init.d/commission
+++ b/etc/init.d/commission
@@ -4,7 +4,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/lighttpd
DAEMONNAME="lighttpd"
NAME=commission
-DESC="Lighttpd Web Server"
+DESC="MT lighttpd Commissioning Server"
OPTS="-f /etc/lighttpd-commission.conf"
PIDFILE=/var/run/lighttpd-commission.pid
CONF_DIR=/var/config
@@ -17,6 +17,7 @@ if (($PASSWORDS == 0)) ; then
# No password, so indicate commissioning mode
# php-fpm-commision will be turned on as well
rm -f "/run/mt-commission"
+ echo 'ENABLED="yes"' >"/run/mt-commission"
else
ENABLED="no"
echo 'ENABLED="no"' >"/run/mt-commission"
@@ -53,7 +54,6 @@ case "$1" in
;;
reload)
echo -n "Reloading $DESC: "
- set -x
pkill -HUP -F ${PIDFILE} "$DAEMONNAME"
echo "$NAME."
;;
diff --git a/etc/init.d/commission-php-fpm b/etc/init.d/commission-php-fpm
index 2f18fbc..e5e1077 100755
--- a/etc/init.d/commission-php-fpm
+++ b/etc/init.d/commission-php-fpm
@@ -10,6 +10,7 @@
# Description: starts the PHP FastCGI Process Manager daemon
### END INIT INFO
+DESC="MT php commissioning server "
NAME="php-fpm-commission"
prefix=/usr
exec_prefix=/usr
@@ -22,8 +23,6 @@ php_fpm_PID="/var/run/${NAME}.pid"
php_opts="-R --fpm-config $php_fpm_CONF --pid $php_fpm_PID"
ENABLED=yes
-[ -f "/run/mt-commission" ] && . "/run/mt-commission"
-
wait_for_pid () {
try=0
@@ -55,7 +54,7 @@ wait_for_pid () {
case "$1" in
start)
- [[ -f /etc/default/commission ]] && . /etc/default/commission
+ [ -f "/run/mt-commission" ] && . "/run/mt-commission"
if [[ $ENABLED != "yes" ]]; then
echo "$NAME: disabled in /run/mt-commission"
exit
diff --git a/usr/libexec/commission/off.sh b/usr/libexec/commission/off.sh
index 4911c47..6bb51b7 100755
--- a/usr/libexec/commission/off.sh
+++ b/usr/libexec/commission/off.sh
@@ -1,4 +1,4 @@
#!/bin/bash
sleep 30
/etc/init.d/commission stop 2>&1 | logger -p local0.crit
-/etc/init.d/php-fpm-commission stop 2>&1 | logger -p local0.crit
+/etc/init.d/commission-php-fpm stop 2>&1 | logger -p local0.crit
diff --git a/www/commission/index.php b/www/commission/index.php
index 00546ab..3e87e7a 100644
--- a/www/commission/index.php
+++ b/www/commission/index.php
@@ -156,7 +156,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
$password_err = $result2;
$username_err = $result;
// Disable commissioning
- $cmd = "echo 'ENABLED=\"no\"' >/var/config/default/commissioning 2>&1";
+ $cmd = "echo 'ENABLED=\"no\"' >/run/mt-commission 2>&1";
$handle = popen($cmd, 'r');
$result = trim(fread($handle, 4192));
$status = pclose($handle);
@@ -166,7 +166,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
} else {
// shut off web server
$cmd = "/usr/sbin/start-stop-daemon -S -p /var/run/commissionoff.pid -b -a /bin/bash -- -c " .
- "/usr/libexec/commissioning/off.sh";
+ "/usr/libexec/commission/off.sh";
syslog(LOG_ALERT, "turn off web server: command: $cmd");
$handle = popen($cmd, 'r');
$result = trim(fread($handle, 4192));