Make LDM password nicer

This commit is contained in:
Martin Lablans
2022-11-03 17:19:15 +01:00
parent d49b4521b0
commit 038d8d69f6
5 changed files with 12 additions and 9 deletions

View File

@ -11,6 +11,13 @@ detectCompose() {
fi
}
setLdmPassword() {
if [ -z "$LDM_PASSWORD" ]; then
log DEBUG "Transforming LDM_PASSWORD into LDM_LOGIN ..."
LDM_LOGIN=$(docker run --rm -it httpd:alpine htpasswd -nb $PROJECT $LDM_PASSWORD | tr -d '\n' | tr -d '\r')
fi
}
exitIfNotRoot() {
if [ "$EUID" -ne 0 ]; then
log "ERROR" "Please run as root"