Created
December 24, 2017 02:01
-
-
Save rtrouton/fb353ae928aa15e61ecab394c9c15dcb to your computer and use it in GitHub Desktop.
Postinstall script for kiosk user account created with pycreateuserpkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# postinstall for local account install | |
if [ "$3" == "/" ] ; then | |
# work around path issue with 'defaults' | |
/usr/bin/defaults write "/Library/Preferences/com.apple.loginwindow" autoLoginUser "kiosk" | |
else | |
/usr/bin/defaults write "$3/Library/Preferences/com.apple.loginwindow" autoLoginUser "kiosk" | |
fi | |
/bin/chmod 644 "$3/Library/Preferences/com.apple.loginwindow.plist" | |
if [ "$3" == "/" ]; then | |
# we're operating on the boot volume | |
# kill local directory service so it will see our local | |
# file changes -- it will automatically restart | |
/usr/bin/killall DirectoryService 2>/dev/null || /usr/bin/killall opendirectoryd 2>/dev/null | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment