Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions check_time_machine_currency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ fi

# Check to see if we're running Mavericks as Time Machine runs a little differently
osVersion=`sw_vers -productVersion | grep -E -o "[0-9]+\.[0-9]"`
isMavericks=`echo $osVersion '< 10.9' | bc -l`
function version { echo "$@" | awk -F. '{ printf("%03d%03d\n", $1,$2); }'; }
if [ "$(version "$osVersion")" -gt "$(version "$10.9")" ]; then
isMavericks=0
else
isMavericks=1
fi

if [ $isMavericks -eq 0 ]
then
Expand Down Expand Up @@ -105,4 +110,4 @@ then
else
printf "CRITICAL - Could not determine the last backup date for this Mac.\n"
exit 2
fi
fi