diff --git a/scripts/actual_jank.sh b/scripts/actual_jank.sh new file mode 100755 index 0000000..d4eff63 --- /dev/null +++ b/scripts/actual_jank.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +SUBDOMAINS=("thirdculture.top" "ppl.thirdculture.top" "files.thirdculture.top" "up.thirdculture.top" +"events.thirdculture.top" "music.thirdculture.top" "social.thirdculture.top" "visual.thirdculture.top") +HOSTS_FILE="/etc/hosts" + +add_subdomains() { + echo "Adding subdomains to /etc/hosts..." + for SUBDOMAIN in "${SUBDOMAINS[@]}"; do + if ! grep -q "$SUBDOMAIN" "$HOSTS_FILE"; then + echo "127.0.0.1 $SUBDOMAIN" | sudo tee -a "$HOSTS_FILE" > /dev/null + echo "Added $SUBDOMAIN to /etc/hosts" + else + echo "$SUBDOMAIN is already in /etc/hosts" + fi + done +} + +remove_subdomains() { + echo "Removing subdomains from /etc/hosts..." + for SUBDOMAIN in "${SUBDOMAINS[@]}"; do + sudo sed -i "/$SUBDOMAIN/d" "$HOSTS_FILE" + echo "Removed $SUBDOMAIN from /etc/hosts" + done +} + +case "$1" in + add) + add_subdomains + ;; + remove) + remove_subdomains + ;; + *) + echo "Usage: $0 {add|remove}" + exit 1 + ;; +esac