added the worst script of my life because nixos doesnt boot
This commit is contained in:
parent
4523db7159
commit
804ff2d9a7
1 changed files with 38 additions and 0 deletions
38
scripts/actual_jank.sh
Executable file
38
scripts/actual_jank.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue