Files
Andreas Vogel 306149a726 test
2026-02-16 15:28:29 +01:00

47 lines
1.4 KiB
Bash

#!/bin/bash
##########################################################################
# Shellscript : Ermöglich das ändern des FileVault-Kennwortes
# Autor : Andreas Vogel, macenterprise gmbh, 30.10.2019
##########################################################################
UUID=$(dscl . -list /Users GeneratedUID | awk '{print $2}' | sort -ug | tail -1)
echo $UUID
askholdPassphrase () {
osascript <<EOF - 2>/dev/null
tell application "SystemUIServer"
activate
text returned of (display dialog "$1" default answer "" with hidden answer)
end tell
EOF
}
askhnewPassphrase () {
osascript <<EOF - 2>/dev/null
tell application "SystemUIServer"
activate
text returned of (display dialog "$1" default answer "" with hidden answer)
end tell
EOF
}
buttonClicked=$(osascript << EOF
button returned of (display dialog "Hier kannst du dein Windows-Passwort und dein FileVault-Kennwort wieder in Sync. bekommen. Fahre nur fort, wenn dein MacBook Passwort nicht dem aktuellen Windows-Passwort entspricht." buttons {"OK", "Cancel"} default button 1)
EOF)
if [[ "$buttonClicked" == "OK" ]]
then
oldPassphrase=$(askholdPassphrase 'Bitte gebe das verwendete Passwort ein') || exit
newPassphrase=$(askholdPassphrase 'Bitte gebe das aktuelle Windows-Passwort ein') || exit
# diskutil apfs changePassphrase disk1s1 -user $UUID -oldPassphrase $oldPassphrase -newPassphrase $newPassphrase
echo PW wurde vergeben
else
exit 0
fi