Fisxed bug related to verbose mode

This commit is contained in:
2024-11-04 08:59:32 +01:00
parent e783c2a176
commit 786c30ef14
3 changed files with 9 additions and 2 deletions

View File

@@ -119,8 +119,12 @@ make_backup() {
if [ "$BACKUP_SH_SHA256" -eq 1 ]; then if [ "$BACKUP_SH_SHA256" -eq 1 ]; then
shopt -s globstar dotglob shopt -s globstar dotglob
for file in "$BACKUP_SH_SUBDIR"/**/*; do for file in "$BACKUP_SH_SUBDIR"/**/*; do
# Skip symbol links and directories # Skip symbolic links and directories
[ -d "$file" ] || [ -L "$file" ] && continue [ -d "$file" ] || [ -L "$file" ] && continue
if [ "$BACKUP_SH_VERBOSE" -eq 1 ]; then
printf "Computing checksum for '%s'...\n" "$file"
fi
gethash "$file" >> "$BACKUP_SH_CHECKSUM_FILE" gethash "$file" >> "$BACKUP_SH_CHECKSUM_FILE"
done done
shopt -u globstar dotglob shopt -u globstar dotglob
@@ -176,6 +180,7 @@ extract_backup() {
BACKUP_SH_VERBOSE="$4" BACKUP_SH_VERBOSE="$4"
# Decrypt the archive # Decrypt the archive
echo "Decrypting backup..."
gpg -a \ gpg -a \
--quiet \ --quiet \
--decrypt \ --decrypt \
@@ -206,7 +211,9 @@ extract_backup() {
printf "[FATAL] - integrity error for '%s'.\n" "$file" printf "[FATAL] - integrity error for '%s'.\n" "$file"
exit 1 exit 1
fi fi
if [ "$BACKUP_SH_VERBOSE" -eq 1 ]; then
printf "[OK] - integrity check for '%s' passed.\n" "$file" printf "[OK] - integrity check for '%s' passed.\n" "$file"
fi
done done
shopt -u globstar dotglob shopt -u globstar dotglob
fi fi

Binary file not shown.

Binary file not shown.