Open mani2care opened 3 years ago
@trice81384
@mani2care This script needs updates for Big Sur (which are coming) due to the need to add different switches to the software update command. It also won't work at all on M1s due to changes apple made in the softwareupdate binary.
Find the changes for others as developed the same and added some changed
can you do compare and change the same
https://github.com/bp88/JSS-Scripts/blob/master/AppleSoftwareUpdate.sh
@trice81384
Change like this to one more step to support the Bigsur
updateCLI(){
# Behavior of softwareupdate has changed in Big Sur
# -ia seems to download updates and not actually install them.
# Use -iaR for updates to be installed.
# This also means that the script will restart/shutdown immediately
if [[ "$OSMajorVersion" -ge 11 ]]; then
/usr/sbin/softwareupdate -iaR --verbose 1>> "$ListOfSoftwareUpdates" 2>> "$ListOfSoftwareUpdates" &
else
# Install all software updates
/usr/sbin/softwareupdate -ia --verbose 1>> "$ListOfSoftwareUpdates" 2>> "$ListOfSoftwareUpdates" &
fi
## Get the Process ID of the last command run in the background ($!) and wait for it to complete (wait)
# If you don't wait, the computer may take a restart action before updates are finished
SUPID=$(echo "$!")
wait $SUPID
SU_EC=$?
echo $SU_EC
return $SU_EC
}
@mani2care I'm debating how I want to handle some of these changes because as of now even with these additions they still don't allow the script to run on Apple silicon
then aware of the supportable for script how its working for the apple silicon https://github.com/grahampugh/erase-install
@mani2care Try this new updated version
In big sur i tried it's not working expected got just reboot only not yet updated.
ntsadmin@NTS-Mani Desktop % sudo ./Apple-Updater-with-deferal.sh No valid deferral count specified. Defaulting to 3 chances. Total chances for user to defer is: 3 No valid defer time found. Defaulting to 5 mins. Machine reboot timer is set to 5 minutes. No valid start day found. Defaulting policy to always on. JAMF Binary found at 9.81 or later location The current day of the week is monday The current policy status is 1 Policy is currently enabled or the Policy Start Day matches today. Restarts required equals 1 Current user is: ntsadmin User choose to defer This was user installation attempt 2 of 3. ntsadmin@NTS-Mani Desktop % sudo ./Apple-Updater-with-deferal.sh No valid deferral count specified. Defaulting to 3 chances. Total chances for user to defer is: 3 No valid defer time found. Defaulting to 5 mins. Machine reboot timer is set to 5 minutes. No valid start day found. Defaulting policy to always on. JAMF Binary found at 9.81 or later location The current day of the week is monday The current policy status is 1 Policy is currently enabled or the Policy Start Day matches today. Restarts required equals 1 Current user is: ntsadmin User choose to defer This was user installation attempt 3 of 3. ntsadmin@NTS-Mani Desktop % sudo ./Apple-Updater-with-deferal.sh Password: No valid deferral count specified. Defaulting to 3 chances. Total chances for user to defer is: 3 No valid defer time found. Defaulting to 5 mins. Machine reboot timer is set to 5 minutes. No valid start day found. Defaulting policy to always on. JAMF Binary found at 9.81 or later location The current day of the week is monday The current policy status is 1 Policy is currently enabled or the Policy Start Day matches today. Restarts required equals 1 Current user is: ntsadmin Forced installation of software updates happening. Retrieving inventory preferences from https://newscorp.jamfcloud.com/... Finding extension attributes... Locating package receipts... Locating hard drive information... Locating accounts... Locating applications... Searching path: /System/Applications Locating software updates... Locating plugins... Searching path: /Library/Internet Plug-Ins Locating printers... Searching path: /Library/Application Support Searching path: /Applications Locating hardware information (macOS 11.0.1)... Gathering application usage information... Submitting data to https://newscorp.jamfcloud.com/...
User Choose to reboot immediately. No matching processes were found