Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free space check changes again in 10.13.4 #47

Closed
njellis opened this issue Mar 19, 2018 · 2 comments
Closed

Free space check changes again in 10.13.4 #47

njellis opened this issue Mar 19, 2018 · 2 comments
Assignees
Milestone

Comments

@njellis
Copy link

njellis commented Mar 19, 2018

First off, great work on this! It's much appreciated.

In my testing of your script, I've found that they have changed diskutil in 10.13.4 (currently beta) back to show "Free Space" instead of "Available Space" like in 10.12.0 - 10.13.3. I think the following changes to your free space check should resolve this (and has so far in my experience). This should give it a bit more future proofing, at least until they change it again...

##Check if free space > 15GB
osMinor=$( /usr/bin/sw_vers -productVersion )
if [[ $osMinor == 10.12.* ]] || [[ $osMinor > 10.12.* ]] && [[ $osMinor < 10.13.4 ]]; then
    freeSpace=$( /usr/sbin/diskutil info / | grep "Available Space" | awk '{print $6}' | cut -c 2- )
else
    freeSpace=$( /usr/sbin/diskutil info / | grep "Free Space" | awk '{print $6}' | cut -c 2- )
fi

Thanks!

@Morcin
Copy link

Morcin commented Apr 23, 2018

This will break a later part of the script that uses the osMinor variable:

##Determine Program Argument
if [[ $osMinor -ge 11 ]]; then
progArgument="osinstallersetupd"
elif [[ $osMinor -eq 10 ]]; then
progArgument="osinstallersetupplaind"
fi

@kc9wwh kc9wwh self-assigned this Apr 27, 2018
@kc9wwh kc9wwh added this to the v2.6.0 milestone Apr 27, 2018
@kc9wwh
Copy link
Owner

kc9wwh commented Apr 27, 2018

All previous references to $osMinor were renamed to $osMajor and the below change was made to the free space check:

##Check if free space > 15GB
osMajor=$( /usr/bin/sw_vers -productVersion | awk -F. {'print $2'} )
osMinor=$( /usr/bin/sw_vers -productVersion | awk -F. {'print $3'} )
if [[ $osMajor -eq 12 ]] || [[ $osMajor -eq 13 && $osMinor -lt 4 ]]; then
    freeSpace=$( /usr/sbin/diskutil info / | grep "Available Space" | awk '{print $6}' | cut -c 2- )
else
    freeSpace=$( /usr/sbin/diskutil info / | grep "Free Space" | awk '{print $6}' | cut -c 2- )
fi

Initial testing was good, will do final testing before merge to master, but if you see an issue with it please reply.

kc9wwh pushed a commit that referenced this issue Apr 27, 2018
@kc9wwh kc9wwh closed this as completed Apr 27, 2018
@kc9wwh kc9wwh mentioned this issue Apr 30, 2018
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants