Created
October 23, 2015 15:07
-
-
Save nicolaballotta/3881bcd662248fb93916 to your computer and use it in GitHub Desktop.
Switch on/off iCloud sync service
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 | |
function cloudOn { | |
launchctl load /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist | |
launchctl load /System/Library/LaunchAgents/com.apple.nsurlsessiond.plist | |
sudo launchctl load /System/Library/LaunchDaemons/com.apple.nsurlsessiond.plist | |
sudo launchctl load /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist | |
} | |
function cloudOff { | |
launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist | |
launchctl unload /System/Library/LaunchAgents/com.apple.nsurlsessiond.plist | |
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlsessiond.plist | |
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist | |
} | |
if [ -z "$1" ]; then | |
echo "Usage: $0 on | off" | |
elif [ "$1" == "on" ]; then | |
echo "Switching cloud on.." | |
cloudOn | |
elif [ "$1" == "off" ]; then | |
echo "Switching cloud off.." | |
cloudOff | |
else | |
echo "Invalid argument" | |
echo "Usage: $0 on | off" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment