Intel booting to recovery mode on macOS updates 13.x using MDM - Script to possibly help

jrepasky
New Contributor III

This was specific to our environment but I could see other environments might run into this or something similar.

Running nightly updates and reboots we ran into an issue with Intel devices that would would boot into recovery mode after updates. We did a bit of troubleshooting and realized it won't happen when you run command line softwareupdate --iaR. We couldn't have full OS updates run on these devices so we had to build a script to do that cleanly. Built a script out that looks for the macOS full installers then does a compare and skips any with the full OS update titles. 

 

#!/bin/bash

echo "Checking for updates..."

# Get list of full macOS installers (e.g., macOS 14.x, Sonoma, etc.)
full_os_install=$(softwareupdate --list-full-installers 2>/dev/null | awk -F': ' '/^ *Title: / {print $2}')

# List available updates
available_updates=$(softwareupdate --list 2>&1)

# Exit if no updates
if echo "$available_updates" | grep -q "No new software available."; then
echo "No updates available."
exit 0
fi

# Extract available update titless
echo "$available_updates" | grep '^\s*\*' | sed 's/^.*\* //' | while read -r titles; do
# Skip full OS installers
if echo "$full_os_install" | grep -Fqx "$titles"; then
echo "Skipping full macOS installer: $titles"
continue
fi

echo "Installing update: $titles"
echo softwareupdate --install "$titles" --agree-to-license
done

echo "Update process complete."

 

0 REPLIES 0