summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rwxr-xr-xetc/init.d/commissioning2
-rwxr-xr-xetc/init.d/php-fpm-commission11
2 files changed, 11 insertions, 2 deletions
diff --git a/etc/init.d/commissioning b/etc/init.d/commissioning
index 4f54267..c04a51a 100755
--- a/etc/init.d/commissioning
+++ b/etc/init.d/commissioning
@@ -15,7 +15,7 @@ ENABLED=yes
if [[ ENABLED == no ]] ; then
PASSWORDS=$(passwd -Sa | egrep '^[^[:space:]]+[[:space:]]P[[:space:]]' | wc -l)
if (($PASSWORDS == 0)) ; then
- # No password, so turn on commissioning
+ # No password, so turn on commissioning (php-fpm-commision will see this)
rm /etc/default/$NAME
ENABLED="yes"
fi
diff --git a/etc/init.d/php-fpm-commission b/etc/init.d/php-fpm-commission
index 37cff70..d61584c 100755
--- a/etc/init.d/php-fpm-commission
+++ b/etc/init.d/php-fpm-commission
@@ -20,8 +20,17 @@ php_fpm_PID="/var/run/${NAME}.pid"
php_opts="-R --fpm-config $php_fpm_CONF --pid $php_fpm_PID"
-ENABLED="yes"
+ENABLED=yes
+[ -f "/etc/default/commissioning" ] && . "/etc/config/commisioning"
+
+# /etc/default/no-${NAME} should point at /etc/default/.no-${NAME}
+# and contain ENABLED="no".
+# This will prevent commissioning on a factory reset
+# but not on an image update for tighter security.
+# If the device is to have no password at all, this file and
+# link must be created, and ENABLED must be set to "no"
+[ -f "/etc/default/no-${NAME}" ] && . "/etc/config/no-${NAME}"
wait_for_pid () {
try=0