OSX-Monitoring-Tools
OSX-Monitoring-Tools copied to clipboard
check_time_machine on 10.10
Hi,
Running on Yosemite the script misinterprets the os version:
# 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`
The grep line appears to return "10.1" instead of "10.10". I fixed this by adding a "+" following the last square bracket. But the real problem is that 10.10 is mathematically less than 10.9 so this area needs new logic I guess. Only using the minor version number, the following hack works for me:
osVersion=`sw_vers -productVersion | grep -E -o "[0-9]+" | tail -n 1`¬
isMavericks=`echo $osVersion '<= 9' | bc -l`¬
How can this be improved? Thanks!
I'm changing my suggested code to:
osVersion=`sw_vers -productVersion | awk -F'.' {'print $2'}`
The previous broke with the latest upgrade.
Improvements?
Thanks! Mark