start: set password for the root user only if `WEBMIN_ENABLED` is `true`

pull/11/head
Sameer Naik 2015-04-14 16:59:17 +05:30
parent 7e2fc54c23
commit 05a8bc8d4e
1 changed files with 5 additions and 5 deletions

10
start
View File

@ -3,11 +3,6 @@ set -e
WEBMIN_ENABLED=${WEBMIN_ENABLED:-true} 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 chmod 775 /data
# create directory for bind config # create directory for bind config
@ -39,6 +34,11 @@ rm -rf /etc/webmin
ln -sf /data/webmin/etc /etc/webmin ln -sf /data/webmin/etc /etc/webmin
if [ "${WEBMIN_ENABLED}" == "true" ]; then 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..." echo "Starting webmin..."
/etc/init.d/webmin start /etc/init.d/webmin start
fi fi