start: do not print the root password when specified in `ROOT_PASSWORD` ENV variable

pull/11/head
Sameer Naik 2015-04-22 17:44:19 +05:30
parent 67f3da6d53
commit 70bcf45aac
1 changed files with 5 additions and 3 deletions

8
start
View File

@ -34,10 +34,12 @@ 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=${ROOT_PASSWORD:-$(pwgen -c -n -1 12)}
if [ -z "${ROOT_PASSWORD}" ]; then
# generate a random password for root
ROOT_PASSWORD=$(pwgen -c -n -1 12)
echo User: root Password: $ROOT_PASSWORD
fi
echo "root:$ROOT_PASSWORD" | chpasswd
echo User: root Password: $ROOT_PASSWORD
echo "Starting webmin..."
/etc/init.d/webmin start