This commit is contained in:
Brian Zalewski 2023-11-13 07:05:01 +00:00
parent 93713c895b
commit c4722328f1

View file

@ -54,14 +54,17 @@ fi
### System upgrade on macOS ### System upgrade on macOS
if [ -d /Applications ] && [ -d /Library ] && [ -z "$NO_RESTART" ]; then if [ -d /Applications ] && [ -d /Library ] && [ -z "$NO_RESTART" ]; then
echo 'bash <(curl -sSL https://install.doctor/start) # TEMPORARY FOR INSTALL DOCTOR MACOS' >> "$HOME/.zshrc" echo 'bash <(curl -sSL https://install.doctor/start) # TEMPORARY FOR INSTALL DOCTOR MACOS' >> "$HOME/.zshrc"
if command -v gtimeout > /dev/null; then # TODO - Section below attempts to add timeout to macOS softwareupdate command but is failing to prompt for password (which is required even with /etc/sudoers set up
logg info 'Ensuring system software is upgraded (timing out after 50 minutes if system upgrade fails)' # if command -v gtimeout > /dev/null; then
gtimeout 3000 sudo softwareupdate -i -a -R || logg warn 'The system update command timed out after 50 minutes' # logg info 'Ensuring system software is upgraded (timing out after 50 minutes if system upgrade fails)'
else # gtimeout 3000 sudo softwareupdate -i -a -R || logg warn 'The system update command timed out after 50 minutes'
# If gtimeout is unavailable, then attempt system upgrade without a timeout (which usually works on fresh systems) # else
logg info 'Applying OS upgrades (if available)' # # If gtimeout is unavailable, then attempt system upgrade without a timeout (which usually works on fresh systems)
sudo softwareupdate -i -a -R || logg error 'Failed to perform a system update via sudo softwareupdate -i -a -R' # logg info 'Applying OS upgrades (if available)'
fi # sudo softwareupdate -i -a -R || logg error 'Failed to perform a system update via sudo softwareupdate -i -a -R'
# fi
logg info 'Applying OS upgrades (if available)'
sudo softwareupdate -i -a -R || logg error 'Failed to perform a system update via sudo softwareupdate -i -a -R'
logg info 'If system updates were downloaded / installed, a reboot might be required.' logg info 'If system updates were downloaded / installed, a reboot might be required.'
if command -v gsed > /dev/null; then if command -v gsed > /dev/null; then
sudo gsed -i '/# TEMPORARY FOR INSTALL DOCTOR MACOS/d' "$HOME/.zshrc" || logg warn "Failed to remove kickstart script from .zshrc" sudo gsed -i '/# TEMPORARY FOR INSTALL DOCTOR MACOS/d' "$HOME/.zshrc" || logg warn "Failed to remove kickstart script from .zshrc"