From 88d59ad6a9881e1664245b1d2740e44addb55d41 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 15 Jun 2015 21:53:21 +0530 Subject: [PATCH] entrypoint.sh: don't bother creating the `WEBMIN_DATA_DIR` if `WEBMIN_ENABLED` is not `true` --- entrypoint.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index cfd3005..43266f9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,20 +29,22 @@ fi rm -rf /var/lib/bind ln -sf ${BIND_DATA_DIR}/lib /var/lib/bind -# create directory for webmin -mkdir -p ${WEBMIN_DATA_DIR} - -# populate the default webmin configuration if it does not exist -if [ ! -d ${WEBMIN_DATA_DIR}/etc ]; then - mv /etc/webmin ${WEBMIN_DATA_DIR}/etc -fi -rm -rf /etc/webmin -ln -sf ${WEBMIN_DATA_DIR}/etc /etc/webmin - # create /var/run/named mkdir -m 0775 -p /var/run/named chown root:${BIND_USER} /var/run/named +if [ "${WEBMIN_ENABLED}" == "true" ]; then + # create directory for webmin + mkdir -p ${WEBMIN_DATA_DIR} + + # populate the default webmin configuration if it does not exist + if [ ! -d ${WEBMIN_DATA_DIR}/etc ]; then + mv /etc/webmin ${WEBMIN_DATA_DIR}/etc + fi + rm -rf /etc/webmin + ln -sf ${WEBMIN_DATA_DIR}/etc /etc/webmin +fi + if [ -z "$@" ]; then if [ "${WEBMIN_ENABLED}" == "true" ]; then if [ -z "${ROOT_PASSWORD}" ]; then