Files
Alte_Skripte/de.ing.Update_OS_with_check.sh
2026-02-16 15:05:15 +01:00

57 lines
1.9 KiB
Bash

#!/bin/bash
#####################################################################################
# Shellscript :
# Autor :
#####################################################################################
#################################### Jamf Helper Variablen ####################################
Icon="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
Message="
Auf dem System ist Xcode 10 installiert.
Xcode 10 steht unter macOS 10.15.X nicht im vollen Umfang zur Verfügung.
Insbesondere stehen die Commandline Tools für Xcode 10 nicht mehr zur Verfügung. Fahre mit dem Update nur vort, wenn die Arbeit auch unter Xcode 11 fortgeführt werden kann.
Xcode 10 is installed on the system.
Xcode 10 is not fully available on macOS 10.15.X.
In particular, the Commandline Tools for Xcode 10 are no longer available. Only proceed with the update if the work can also be continued under Xcode 11.
"
#################################### Prüfung der Xcode Version ####################################
listeXcode=$(ls -ls /Applications/ | grep 'Xcode' | cut -d _ -f 2 | cut -d . -f 1)
echo $listeXcode
for i in $listeXcode
do
if [ $i -lt 11 ]
then
Xcode="10"
fi
done
#################################### Nachrichten und Befehle ####################################
Warning()
{
HELPER=$(/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility -icon "$Icon" -title "Warning" -description "$Message" -button1 "OK" -button2 "Cancel" -cancelButton "2" -defaultButton 2)
}
ExecuteUpdate()
{
/Applications/Install\ macOS\ Catalina.app/Contents/Resources/startosinstall --agreetolicense --nointeraction
}
#################################### Ausführung ####################################
if [[ $Xcode == "10" ]]
then
echo "1"
Warning
if [ "$HELPER" == "0" ]
then
echo "1.1"
ExecuteUpdate
else
echo "1.2"
exit 0
fi
else
echo "2"
ExecuteUpdate
fi