Integrity check can now ignore symbolic links
All checks were successful
backup.sh / bash (push) Successful in 11s
All checks were successful
backup.sh / bash (push) Successful in 11s
This commit is contained in:
parent
b520b6b72c
commit
2bb255840d
@ -107,8 +107,8 @@ 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 directories
|
# Skip symbol links and directories
|
||||||
[ -d "$file" ] && continue
|
[ -d "$file" ] || [ -L "$file" ] && continue
|
||||||
gethash "$file" >> "$BACKUP_SH_CHECKSUM_FILE"
|
gethash "$file" >> "$BACKUP_SH_CHECKSUM_FILE"
|
||||||
done
|
done
|
||||||
shopt -u globstar dotglob
|
shopt -u globstar dotglob
|
||||||
@ -173,8 +173,8 @@ extract_backup() {
|
|||||||
if [ -n "$BACKUP_SH_SHA256_FILE" ]; then
|
if [ -n "$BACKUP_SH_SHA256_FILE" ]; then
|
||||||
shopt -s globstar dotglob
|
shopt -s globstar dotglob
|
||||||
for file in "backup.sh.tmp"/**/*; do
|
for file in "backup.sh.tmp"/**/*; do
|
||||||
# Skip directories
|
# Skip symbolic links and directories
|
||||||
[ -d "$file" ] && continue;
|
[ -d "$file" ] || [ -L "$file" ] && continue;
|
||||||
# Compute sha256 for current file
|
# Compute sha256 for current file
|
||||||
SHA256="$(gethash "$file")"
|
SHA256="$(gethash "$file")"
|
||||||
# Check if checksum file contains hash
|
# Check if checksum file contains hash
|
||||||
|
Loading…
Reference in New Issue
Block a user