Open FyrbyAdditive opened 4 years ago
@timtimellis Thank you for you feedback. I'll update our script after this weekend. Please wait for a little while longer.
This logic didn't seem to work for me on 10.14-- and testing the logic with 10.14.1-10.14.3 as os_ver all result in report of null Freespace, as they're falling into the else statement and checking the plist for "AvailableSpace".
if [[ "${ver[1]}" -ge 15 ]]; then
# Is 10.15 or newer
di_check="APFSContainerFree"
elif [[ "${ver[1]}" -eq 14 ]]; then
# Is 10.14.x
di_check="FreeSpace"
elif [[ "${ver[1]}" -eq 13 ]] && [[ "${ver[2]}" -ge 4 ]]; then
# Is 10.13.4 - 10.13.6
di_check="FreeSpace"
else
# Is a blatant security risk
di_check="AvailableSpace"
fi
This appears to work correctly for the above versions, perhaps this will help others.
I'll confirm I've used the noted modifications for upgrading from Mojave to Catalina as well as erase install over Mojave and Catalina.
This logic didn't seem to work for me on 10.14-- and testing the logic with 10.14.1-10.14.3 as os_ver all result in report of null Freespace, as they're falling into the else statement and checking the plist for "AvailableSpace".
if [[ "${ver[1]}" -ge 15 ]]; then # Is 10.15 or newer di_check="APFSContainerFree" elif [[ "${ver[1]}" -eq 14 ]]; then # Is 10.14.x di_check="FreeSpace" elif [[ "${ver[1]}" -eq 13 ]] && [[ "${ver[2]}" -ge 4 ]]; then # Is 10.13.4 - 10.13.6 di_check="FreeSpace" else # Is a blatant security risk di_check="AvailableSpace" fi
This appears to work correctly for the above versions, perhaps this will help others.
The di_check for older than 10.13.4 isn't working for me with 10.12.6-- I ended up changing the else statement to use di_check="FreeSpace" and I was able to upgrade 10.12.6 successfully. I don't have anything older to test on, nor a 10.13.3--- is the di_check="AvailableSpace" actually needed?
## 10.13.4 or later, diskutil info command output changes key from 'AvailableSpace' to 'Free Space' about disk space. ## 10.15 or later changes it to 'APFSContainerFree' os_ver=$(sw_vers -productVersion) IFS='.' read -r -a ver <<< "$os_ver" if [[ "${ver[1]}" -ge 15 ]]; then # Is 10.15 or newer di_check="APFSContainerFree" elif [[ "${ver[1]}" -ge 13 ]] && [[ "${ver[2]}" -ge 4 ]]; the # Is 10.13.4 - 10.14.latest di_check="FreeSpace" else # Is a blatant security risk di_check="AvailableSpace" fi diskInfoPlist=$(/usr/sbin/diskutil info -plist /) freeSpace=$( /usr/libexec/PlistBuddy -c "Print :${di_check}" /dev/stdin <<< "$diskInfoPlist" 2>/dev/null )
This is missing the letter 'n' for the elif statement for 'then'. If anyone else is having trouble.