From 714690591f585fe20fe56f9ac4bde664ff4aaea1 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 15 Jun 2015 21:55:44 +0530 Subject: [PATCH] entrypoint.sh: start webmin if `WEBMIN_ENABLED` is `true`, regardless of whether a user command is specified --- entrypoint.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 43266f9..83100b8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -43,20 +43,19 @@ if [ "${WEBMIN_ENABLED}" == "true" ]; then fi rm -rf /etc/webmin ln -sf ${WEBMIN_DATA_DIR}/etc /etc/webmin + + # generate a random password for root + if [ -z "${ROOT_PASSWORD}" ]; then + ROOT_PASSWORD=$(pwgen -c -n -1 12) + echo User: root Password: $ROOT_PASSWORD + fi + echo "root:$ROOT_PASSWORD" | chpasswd + + echo "Starting webmin..." + /etc/init.d/webmin start fi if [ -z "$@" ]; then - if [ "${WEBMIN_ENABLED}" == "true" ]; then - 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 "Starting webmin..." - /etc/init.d/webmin start - fi echo "Starting named..." exec /usr/sbin/named -u ${BIND_USER} -g else