21 lines
706 B
Bash
21 lines
706 B
Bash
#!/bin/bash
|
|
##########################################################################
|
|
# Shellscript : Reinstall macOS
|
|
# Autor : Andreas Vogel, NEXT Enterprise gmbh, 2021
|
|
##########################################################################
|
|
set -x
|
|
|
|
|
|
Installer=$(find /Applications -type d -name 'Install macOS*')
|
|
echo $Installer
|
|
|
|
if [ -d "$Installer" ]
|
|
then
|
|
"$Installer"/Contents/Resources/startosinstall --eraseinstall --newvolumename "Macintosh HD" --agreetolicense
|
|
|
|
else
|
|
softwareupdate --fetch-full-installer
|
|
Installer=$(find /Applications -type d -name 'Install macOS*')
|
|
"$Installer"/Contents/Resources/startosinstall --eraseinstall --newvolumename "Macintosh HD" --agreetolicense
|
|
|
|
fi |