This commit is contained in:
Brian Zalewski 2023-12-25 03:05:09 +00:00
parent 0ca8aa53a0
commit 4ce7a414e4
2 changed files with 36 additions and 34 deletions

View file

@ -8,9 +8,10 @@
handleRequiredReboot() { handleRequiredReboot() {
if [ -d /Applications ] && [ -d /System ]; then if [ -d /Applications ] && [ -d /System ]; then
### macOS ### macOS
logg info 'Checking if there is a pending update' && defaults read /Library/Updates/index.plist InstallAtLogout if ! defaults read /Library/Updates/index.plist InstallAtLogout 2>&1 | grep 'does not exist' > /dev/null; then
# TODO - Uncomment this when we can determine conditions for reboot logg info 'There appears to be an update that requires a reboot'
# sudo shutdown -r now logg info 'Attempting to reboot gracefully' && osascript -e 'tell application "Finder" to shut down'
fi
elif [ -f /var/run/reboot-required ]; then elif [ -f /var/run/reboot-required ]; then
### Linux ### Linux
logg info '/var/run/reboot-required is present so a reboot is required' logg info '/var/run/reboot-required is present so a reboot is required'

View file

@ -300,9 +300,10 @@ ensureHomebrew() {
handleRequiredReboot() { handleRequiredReboot() {
if [ -d /Applications ] && [ -d /System ]; then if [ -d /Applications ] && [ -d /System ]; then
### macOS ### macOS
logg info 'Checking if there is a pending update' && defaults read /Library/Updates/index.plist InstallAtLogout if ! defaults read /Library/Updates/index.plist InstallAtLogout 2>&1 | grep 'does not exist' > /dev/null; then
# TODO - Uncomment this when we can determine conditions for reboot logg info 'There appears to be an update that requires a reboot'
# sudo shutdown -r now logg info 'Attempting to reboot gracefully' && osascript -e 'tell application "Finder" to shut down'
fi
elif [ -f /var/run/reboot-required ]; then elif [ -f /var/run/reboot-required ]; then
### Linux ### Linux
logg info '/var/run/reboot-required is present so a reboot is required' logg info '/var/run/reboot-required is present so a reboot is required'