Skip to content

Instantly share code, notes, and snippets.

@zackn9ne
Last active December 2, 2018 17:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zackn9ne/d25256eace2b6bcd35dcf78fa0a7f554 to your computer and use it in GitHub Desktop.
sysadmin script to update macOS mojave in various ways (office and macOs)
#!/bin/sh
read -n 1 -s -r -p "Press any key to check macOS updates!"
macvalue=$( softwareupdatre -l | grep -ic "No new software available.")
if [ $macvalue -eq 1 ]
then
echo "No macOS updates"
else
read -n 1 -s -r -p "Press any key to run macOS updates!"
softwareupdate -i -a
echo "you may wanna reboot"
fi
read -n 1 -s -r -p "Press any key to check microsoft office updates!"
cd /Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS
value=$( ./msupdate --list | grep -ic "No updates")
if [ $value -eq 1 ]
then
echo "I found no updates"
else
read -n 1 -s -r -p "Press any key to run Microsoft Office updates!"
./msupdate --install
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment