big update
This commit is contained in:
parent
833e967aee
commit
72c73f9b18
30 changed files with 132 additions and 60 deletions
24
.local/bin/vpn
Executable file
24
.local/bin/vpn
Executable 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"
|
Loading…
Add table
Add a link
Reference in a new issue