big update

This commit is contained in:
ange 2024-12-27 11:43:30 +00:00
parent 833e967aee
commit 72c73f9b18
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
30 changed files with 132 additions and 60 deletions

24
.local/bin/vpn Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash -e
function off() {
local ifs
read -ra ifs < <(wg show interfaces) || true
for i in "${ifs[@]}"; do
wg-quick down "$i"
done
}
[ "$EUID" != 0 ] && { pkexec bash -c "DISPLAY='$DISPLAY' XAUTHORITY='$XAUTHORITY' $0 $*"; exit; }
[ "$1" == off ] && { off; exit; }
if [ -n "$DISPLAY" ]; then
if="$(basename -s.conf /etc/wireguard/*.conf | /usr/local/bin/dmenu)"
else
select if in $(basename -s.conf /etc/wireguard/*.conf); do
break
done
fi
off
wg-quick up "$if"