OSX-Monitoring-Tools icon indicating copy to clipboard operation
OSX-Monitoring-Tools copied to clipboard

check_time_machine on 10.10

Open clayton256 opened this issue 10 years ago • 1 comments

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!

clayton256 avatar Oct 18 '14 13:10 clayton256

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

clayton256 avatar Nov 18 '14 20:11 clayton256