Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Created December 24, 2017 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrouton/fb353ae928aa15e61ecab394c9c15dcb to your computer and use it in GitHub Desktop.
Save rtrouton/fb353ae928aa15e61ecab394c9c15dcb to your computer and use it in GitHub Desktop.
Postinstall script for kiosk user account created with pycreateuserpkg
#!/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