-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloud.sh
More file actions
25 lines (25 loc) · 997 Bytes
/
cloud.sh
File metadata and controls
25 lines (25 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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