This commit is contained in:
Brian Zalewski 2024-01-02 01:44:13 +00:00
parent 75ef11bf73
commit 83a6ab579f

View file

@ -131,9 +131,11 @@ upgradeDarwin() {
fi
### Run upgrade process
logg info 'Listing available OS upgrades'
UPDATE_CHECK="$(softwareupdate -l)"
logg info 'Checking for available OS upgrades'
UPDATE_CHECK="$(softwareupdate -l 2>&1)"
if ! echo "$UPDATE_CHECK" | grep "No new software available" > /dev/null; then
logg info 'There are available OS upgrades'
echo "$UPDATE_CHECK"
logg info 'Applying OS upgrades (if available). This may take awhile..'
expect -c "set timeout -1
spawn sudo softwareupdate -i -a --agree-to-license
@ -171,6 +173,8 @@ upgradeDarwin() {
else
logg info 'No reboot required for softwareupdate'
fi
else
logg info 'There are no available OS upgrades'
fi
if [ -f "$HOME/.zshrc" ]; then