🔧 Various reconfiguration/scripting
This commit is contained in:
parent
8860d36d1b
commit
921f082ffa
4 changed files with 47 additions and 3 deletions
22
scripts/vpndown
Executable file
22
scripts/vpndown
Executable 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
15
scripts/vpnup
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue