From b04a5b541d977bc303442e8706a7817afddf2752 Mon Sep 17 00:00:00 2001 From: Michael <30936296+mtan93@users.noreply.github.com> Date: Wed, 31 May 2023 21:41:06 +0100 Subject: [PATCH] fixed critical error --- tmbackupstate.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tmbackupstate.sh b/tmbackupstate.sh index 1c0d259..e0dcd7a 100644 --- a/tmbackupstate.sh +++ b/tmbackupstate.sh @@ -1,6 +1,17 @@ #!/bin/sh #WARNINGDAYS=14 #CRITICALDAYS=30 + +if [ -z "$WARNINGDAYS" ] +then +WARNINGDAYS=14 +fi + +if [ -z "$CRITICALDAYS" ] +then +CRITICALDAYS=30 +fi + enabled=$(/usr/bin/defaults read /Library/Preferences/com.apple.TimeMachine AutoBackup) if [ "$enabled" == "1" ];then datetoday=$(date +%s)