Skip to content

Commit

Permalink
Remove iCloud config pop-up from all VM users
Browse files Browse the repository at this point in the history
  • Loading branch information
Sauraus committed Oct 20, 2017
1 parent a14cc4d commit d282457
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions packer/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"../scripts/add-network-interface-detection.sh",
"../scripts/autologin.sh",
"../scripts/system-update.sh",
"../scripts/osx_config.sh",
"../scripts/shrink.sh"
],
"environment_vars": [
Expand Down
16 changes: 16 additions & 0 deletions scripts/osx_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

sw_vers=$(sw_vers -productVersion)
sw_build=$(sw_vers -buildVersion)

# Dissable the spindump process
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist

# Skip the whole iCloud setup step for all users
for USER_TEMPLATE in "/System/Library/User Template"/*
do
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${sw_vers}"
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${sw_build}"
done
10 changes: 10 additions & 0 deletions scripts/vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ fi
# Create a group and assign the user to it
dseditgroup -o create "$USERNAME"
dseditgroup -o edit -a "$USERNAME" "$USERNAME"

# Skip iCloud setup for $USERNAME
sw_vers=$(sw_vers -productVersion)
sw_build=$(sw_vers -buildVersion)
mkdir -p "/Users/$USERNAME/LibraryPreferences"
defaults write "/Users/$USERNAME/Library/Preferences/com.apple.SetupAssistant" DidSeeCloudSetup -bool TRUE
defaults write "/Users/$USERNAME/Library/Preferences/com.apple.SetupAssistant" GestureMovieSeen none
defaults write "/Users/$USERNAME/Library/Preferences/com.apple.SetupAssistant" LastSeenCloudProductVersion "${sw_vers}"
defaults write "/Users/$USERNAME/Library/Preferences/com.apple.SetupAssistant" LastSeenBuddyBuildVersion "${sw_build}"

0 comments on commit d282457

Please sign in to comment.