Merge pull request #121 from samply/chown-message

Fix error messages about wrong permissions
This commit is contained in:
Martin Lablans 2023-09-25 10:23:50 +02:00 committed by GitHub
commit b07731442b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ source $CONFFILE
assertVarsNotEmpty SITE_ID || fail_and_report 1 "Update failed: SITE_ID empty" assertVarsNotEmpty SITE_ID || fail_and_report 1 "Update failed: SITE_ID empty"
export SITE_ID export SITE_ID
checkOwner . bridgehead || fail_and_report 1 "Update failed: Wrong permissions in $(pwd)" checkOwner /srv/docker/bridgehead bridgehead || fail_and_report 1 "Update failed: Wrong permissions in /srv/docker/bridgehead"
checkOwner /etc/bridgehead bridgehead || fail_and_report 1 "Update failed: Wrong permissions in /etc/bridgehead" checkOwner /etc/bridgehead bridgehead || fail_and_report 1 "Update failed: Wrong permissions in /etc/bridgehead"
CREDHELPER="/srv/docker/bridgehead/lib/gitpassword.sh" CREDHELPER="/srv/docker/bridgehead/lib/gitpassword.sh"
@ -116,7 +116,7 @@ if [ -n "${BACKUP_DIRECTORY}" ]; then
mkdir -p "$BACKUP_DIRECTORY" mkdir -p "$BACKUP_DIRECTORY"
chown -R "$BACKUP_DIRECTORY" bridgehead; chown -R "$BACKUP_DIRECTORY" bridgehead;
fi fi
checkOwner "$BACKUP_DIRECTORY" bridgehead || fail_and_report 1 "Automatic maintenance failed: Wrong permissions for backup directory $(pwd)" checkOwner "$BACKUP_DIRECTORY" bridgehead || fail_and_report 1 "Automatic maintenance failed: Wrong permissions for backup directory $BACKUP_DIRECTORY"
# Collect all container names that contain '-db' # Collect all container names that contain '-db'
BACKUP_SERVICES="$(docker ps --filter name=-db --format "{{.Names}}" | tr "\n" "\ ")" BACKUP_SERVICES="$(docker ps --filter name=-db --format "{{.Names}}" | tr "\n" "\ ")"
log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES"; log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES";