Skip to content

Commit

Permalink
Fix error at end of email part 2
Browse files Browse the repository at this point in the history
Fix error at the end of email with condition "WARNING Forced sync with deleted files"
Finally fixes #74
  • Loading branch information
auanasgheps committed Feb 15, 2024
1 parent 7177fa6 commit 37b7747
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snapraid-aio-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
######################
# SCRIPT VARIABLES #
######################
SNAPSCRIPTVERSION="3.3" #DEV8
SNAPSCRIPTVERSION="3.3" #DEV9

# Read SnapRAID version
SNAPRAIDVERSION="$(snapraid -V | sed -e 's/snapraid v\(.*\)by.*/\1/')"
Expand Down Expand Up @@ -766,8 +766,9 @@ SUMMARY: Equal [$EQ_COUNT] - Added [$ADD_COUNT] - Deleted [$DEL_COUNT] - Moved [
fi

if [ "$DEL_COUNT" -ge "$DEL_THRESHOLD" ] && [ "$DO_SYNC" -eq 1 ]; then
if [ "$(echo "$ADD_DEL_THRESHOLD" == 0 | bc -l)" -eq 1 ]; then
MSG="Forced sync with deleted files ($DEL_COUNT) / ($DEL_THRESHOLD) violation"
if [ "$(echo "$ADD_DEL_RATIO < $ADD_DEL_THRESHOLD" | bc -l)" -eq 1 ]; then
elif [ "$(echo "$ADD_DEL_RATIO < $ADD_DEL_THRESHOLD" | bc -l)" -eq 1 ]; then
MSG="Sync forced with multiple violations - Deleted files ($DEL_COUNT) / ($DEL_THRESHOLD) and add/delete ratio ($ADD_DEL_RATIO) / ($ADD_DEL_THRESHOLD)"
fi
fi
Expand Down

0 comments on commit 37b7747

Please sign in to comment.