From cee49fe968d3201569238be3bf4cd596256a99ea Mon Sep 17 00:00:00 2001 From: tofran Date: Sun, 4 Oct 2020 20:29:33 +0100 Subject: [PATCH] Prevent the output of illogical warnings --- backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup.sh b/backup.sh index 6db5a7b..9f5c13d 100755 --- a/backup.sh +++ b/backup.sh @@ -72,7 +72,7 @@ log-warning () { # Check for missing encouraged arguments if ! $SUPPRESS_WARNINGS; then - if [[ $SCREEN_NAME == "" ]]; then + if $ENABLE_CHAT_MESSAGES && [[ $SCREEN_NAME == "" ]]; then log-warning "Minecraft screen name not specified (use -s)" fi fi @@ -194,7 +194,7 @@ delete-thinning () { # Warn if $MAX_BACKUPS does not have enough room for all the blocks TOTAL_BLOCK_SIZE=$(array-sum ${BLOCK_SIZES[@]}) - if [[ $TOTAL_BLOCK_SIZE -gt $MAX_BACKUPS ]]; then + if [[ $MAX_BACKUPS != -1 ]] && [[ $TOTAL_BLOCK_SIZE -gt $MAX_BACKUPS ]]; then if ! $SUPPRESS_WARNINGS; then log-warning "MAX_BACKUPS ($MAX_BACKUPS) is smaller than TOTAL_BLOCK_SIZE ($TOTAL_BLOCK_SIZE)" fi