Last active
June 23, 2024 21:47
-
-
Save johngrinalds/e1eba94db0218256a766cf0e011b8904 to your computer and use it in GitHub Desktop.
setup.sh
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 | |
# setup.sh | |
# focusmanager | |
# | |
# Created by John Grinalds on 6/22/24. | |
# | |
# Check if a user argument is provided | |
if [ -z "$1" ]; then | |
echo "Usage: $0 USER" | |
exit 1 | |
fi | |
USER=$1 | |
# Backup the /etc/hosts file | |
sudo cp /etc/hosts /etc/hosts.backup | |
# Create a symbolic link for the hosts file in the user's focusmanager directory | |
sudo ln -f /etc/hosts /Users/$USER/Library/Containers/com.johngrinalds.focusmanager/Data/Documents/focusmanager-hosts | |
# Change the ownership of the focusmanager-hosts file to the specified user | |
sudo chown $USER:staff /Users/$USER/Library/Containers/com.johngrinalds.focusmanager/Data/Documents/focusmanager-hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment