keep htpasswd if no env vars given and create a new one when not exist

This commit is contained in:
Christoph Roeder 2017-06-08 14:50:09 +02:00
parent abb1b05519
commit 7b994d5fef

View File

@ -34,7 +34,11 @@ if [ -f /firstrun ]; then
# Configure WEB UI access
if [ ! -f /etc/backuppc/htpasswd ]; then
htpasswd -b -c /etc/backuppc/htpasswd ${BACKUPPC_WEB_USER:-backuppc} ${BACKUPPC_WEB_PASSWD:-password}
htpasswd -b -c /etc/backuppc/htpasswd "${BACKUPPC_WEB_USER:-backuppc}" "${BACKUPPC_WEB_PASSWD:-password}"
elif [ -n "$BACKUPPC_WEB_USER" -a -n "$BACKUPPC_WEB_PASSWD" ]; then
touch /etc/backuppc/htpasswd
htpasswd -b /etc/backuppc/htpasswd "${BACKUPPC_WEB_USER}" "${BACKUPPC_WEB_PASSWD}"
fi
# Prepare lighttpd