Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Created June 1, 2014 18:04
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/809fd31aa91501ba0124 to your computer and use it in GitHub Desktop.
Save rtrouton/809fd31aa91501ba0124 to your computer and use it in GitHub Desktop.
Postinstall script for payload-free package which fixes the Users folder being hidden when iTunes 11.2 is installed and Find My Mac is enabled.
#!/bin/bash
# Detects if /Users is present
# If /Users is present, the
# chflags command will unhide it
if [[ -d "$3/Users" ]]; then
chflags nohidden "$3/Users"
fi
# Detects if /Users/Shared is present
# If /Users/Shared is present, the
# chflags command will unhide it
if [[ -d "$3/Users/Shared" ]]; then
chflags nohidden "$3/Users/Shared"
fi
# Runs a permissions repair to fix
# the world-writable permission on
# /Users
diskutil repairPermissions "$3"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment