Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # ---------------------------------------------------------------------------
- # script intended to address the following after any combo update is run:
- # 1. suppress iCloud wizard for all current/future/root users
- # 2. suppress bluetooth wizard for all current/future/root users
- # 3. Remove the directory causing "local itmes" keychain errors
- # ---------------------------------------------------------------------------
- #--- variables
- over500=`dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }'`
- sw_vers=$(sw_vers -productVersion)
- sw_build=$(sw_vers -buildVersion)
- Root="/private/var/root"
- SetUp="/Library/Preferences/com.apple.SetupAssistant"
- Bluetooth="/Library/Preferences/com.apple.Bluetooth"
- Log="/Library/Logs/YourOrgLogs/"
- #--- Set Logging
- if [ ! -d "${Log}" ];
- then
- mkdir $Log
- chown root:wheel $Log
- chmod 777 $Log
- fi
- exec >> "${Log}"/PostComboUpdate.log 2>&1
- #----------------------------------------------------------
- # Timestamp
- #----------------------------------------------------------
- echo ""
- echo ""
- echo "###################################"
- echo "##### `date "+%A %m/%d/%Y %H:%M"`"
- echo "###################################"
- echo ""
- echo ""
- # for all future users
- for i in "/System/Library/User Template"/*
- do
- # stop icloud wizard
- defaults write "${i}"$SetUp DidSeeCloudSetup -bool TRUE
- defaults write "${i}"$SetUp GestureMovieSeen none
- defaults write "${i}"$SetUp LastSeenBuddyBuildVersion "${sw_build}"
- defaults write "${i}"$SetUp LastSeenCloudProductVersion "${sw_vers}"
- # stop bluetooth pop-up
- defaults write "${i}"$Bluetooth BluetoothAutoSeekPointingDevice -bool false
- defaults write "${i}"$Bluetooth BluetoothAutoSeekKeyboard -bool false
- echo "The $i user template has been fixed to suppress any iCloud or bluetooth pop-up wizards."
- done
- echo ""
- echo ""
- # for all current users
- for i in $over500
- do
- if [ ! "${i}" = "Guest" ]; then
- if [ -d /Users/"${i}"/Library ]; then
- # stop icloud wizard
- defaults write /Users/"${i}"$SetUp DidSeeCloudSetup -bool TRUE
- defaults write /Users/"${i}"$SetUp GestureMovieSeen none
- defaults write /Users/"${i}"$SetUp LastSeenBuddyBuildVersion "${sw_build}"
- defaults write /Users/"${i}"$SetUp LastSeenCloudProductVersion "${sw_vers}"
- # stop bluetooth pop-up
- defaults write /Users/"${i}"$Bluetooth BluetoothAutoSeekPointingDevice -bool false
- defaults write /Users/"${i}"$Bluetooth BluetoothAutoSeekKeyboard -bool false
- # ensure files have correct ownership:permissions
- chown "${i}":staff /Users/"${i}"$SetUp.plist
- chown "${i}":staff /Users/"${i}"$Bluetooth.plist
- # delete problem directory from the keychains folder
- rm -drv /Users/"${i}"/Library/Keychains/********-****
- echo "The $i user account has been fixed to suppress any iCloud, keychain or bluetooth errors on startup."
- fi
- fi
- done
- echo ""
- echo ""
- # for the root user
- if [ -d "${Root}"/Library ]; then
- # stop icloud wizard
- defaults write "${Root}"$SetUp DidSeeCloudSetup -bool TRUE
- defaults write "${Root}"$SetUp GestureMovieSeen none
- defaults write "${Root}"$SetUp LastSeenBuddyBuildVersion "${sw_build}"
- defaults write "${Root}"$SetUp LastSeenCloudProductVersion "${sw_vers}"
- # stop bluetooth pop-up
- defaults write "${Root}"$Bluetooth BluetoothAutoSeekPointingDevice -bool false
- defaults write "${Root}"$Bluetooth BluetoothAutoSeekKeyboard -bool false
- # ensure files have correct ownership:permissions
- chown root:wheel "${Root}"$SetUp.plist
- chown root:wheel "${Root}"$Bluetooth.plist
- # delete problem directory from the keychains folder
- rm -drv "${Root}"/Keychains/********-****
- echo "The root user has been fixed to suppress any iCloud, keychain or bluetooth errors on startup."
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement