Create erase-install.sh

This commit is contained in:
Michael
2022-11-15 12:07:33 +00:00
committed by GitHub
parent 65647e25ab
commit 58624a57b8

31
Helpers/erase-install.sh Normal file
View File

@@ -0,0 +1,31 @@
#DEVSCRIPT
EIRUNCOMMAND="curl -s https://raw.githubusercontent.com/grahampugh/erase-install/main/erase-install.sh | sudo bash /dev/stdin --depnotify --check-power --power-wait-limit 180 ---erase --current-user --os=$MOSVERSION"
# VERSION MUST BE PASSED THROUGH CONSOLE (EXPORTED) FOR $MOSVERSION
export EIRUNCOMMAND
#CHECKS FOR REQUIRED FILES
if [ ! -e "/usr/local/Installomator/Installomator.sh" ]; then
curl -s https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Installomator.sh?v=123$(date +%s) | bash
fi
if [ ! -e "/usr/local/bin/dialog" ]; then
/usr/local/Installomator/Installomator.sh swiftdialog NOTIFY=silent BLOCKING_PROCESS_ACTION=kill
fi
if [ ! -e "/Applications/Utilities/DEPNotify.app/Contents/MacOS/DEPNotify" ]; then
/usr/local/Installomator/Installomator.sh depnotify NOTIFY=silent BLOCKING_PROCESS_ACTION=kill
fi
if [ "$SHOWDIALOG" == "Y" ]; then
echo "Dialog will open"
/usr/local/bin/dialog dialog --title "Purple Managed macOS Updates" --message "**WARNING: Restart Required** \n\nYou are about to install an OS update which could take up to 1 hour 30 minutes to install. \n\n Please confirm you have saved all work and wish to continue?" --blurscreen --icon "https://www.apple.com/newsroom/images/product/os/macos/standard/Apple-WWDC22-macOS-Ventura-Spotlight-show-220606_big.jpg.large.jpg" --overlayicon warning --ontop --button1text "Continue" --button1shellaction "$EIRUNCOMMAND" --button2text "Later"
else
echo "Dialog will not open"
echo Continuing...
$EIRUNCOMMAND
fi
#PROMPTS WITH INSTALL
#EXITS
exit 0