🔧 Various reconfiguration/scripting

This commit is contained in:
tomit4 2025-08-25 15:25:49 -07:00
parent 8860d36d1b
commit 921f082ffa
4 changed files with 47 additions and 3 deletions

22
scripts/vpndown Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
main() {
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "This script must be run as root!"
exit 1
else
set +o noclobber
sv stop wireguard
cat <<EOF >/etc/resolv.conf
nameserver ::1
nameserver 127.0.0.1
options trust-ad
EOF
chattr +i /etc/resolv.conf
docker container start pihole-unbound
sv restart NetworkManager
set -o noclobber
fi
}
main

15
scripts/vpnup Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
main() {
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "This script must be run as root!"
exit 1
else
docker container stop pihole-unbound
chattr -i /etc/resolv.conf 2>/dev/null
sv restart NetworkManager
sv start wireguard
fi
}
main