-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·22 lines (19 loc) · 904 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
mkdir -p /Users/Shared/.scripts/pleasefocusalready/hosts
touch ./hosts/hosts.default.custom
touch ./hosts/hosts.peak.custom
cp ./scripts/copyhosts.sh /Users/Shared/.scripts/pleasefocusalready/copyhosts.sh
cp ./hosts/* /Users/Shared/.scripts/pleasefocusalready/hosts/
printf "Heads up! I'm going to add the scheduled stuff using launchctl. This needs sudo and you might be prompted for the password :)\n"
sleep 1
sudo cp ./schedules/* ~/Library/LaunchAgents/
sudo launchctl remove com.pleasefocusalready.peak
sudo launchctl remove com.pleasefocusalready.offpeak
sudo launchctl load ~/Library/LaunchAgents/com.pleasefocusalready.peak.plist
sudo launchctl load ~/Library/LaunchAgents/com.pleasefocusalready.offpeak.plist
printf "\n\nWould you like to activate the focus zone now? (y/n)"
read answer
if [ $answer == "y" ]
then
/Users/Shared/.scripts/pleasefocusalready/copyhosts.sh peak
fi