From 05a8bc8d4eee5f8f006370957eadb093831f166b Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Tue, 14 Apr 2015 16:59:17 +0530 Subject: [PATCH] start: set password for the root user only if `WEBMIN_ENABLED` is `true` --- start | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/start b/start index 663b489..1453d4b 100755 --- a/start +++ b/start @@ -3,11 +3,6 @@ set -e WEBMIN_ENABLED=${WEBMIN_ENABLED:-true} -# generate a password for root. -ROOT_PASSWORD=$(pwgen -c -n -1 12) -echo "root:$ROOT_PASSWORD" | chpasswd -echo User: root Password: $ROOT_PASSWORD - chmod 775 /data # create directory for bind config @@ -39,6 +34,11 @@ rm -rf /etc/webmin ln -sf /data/webmin/etc /etc/webmin if [ "${WEBMIN_ENABLED}" == "true" ]; then + # set root password so that we can login via webmin + ROOT_PASSWORD=$(pwgen -c -n -1 12) + echo "root:$ROOT_PASSWORD" | chpasswd + echo User: root Password: $ROOT_PASSWORD + echo "Starting webmin..." /etc/init.d/webmin start fi