Add wg() function

This commit is contained in:
Sam A. 2022-09-25 21:22:18 +02:00
parent d2906e8f11
commit 66fbb26ccc
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA

View file

@ -59,3 +59,14 @@ open() {
fi
}
wg() {
(( ${+commands[wg]} )) && (( ${+commands[wg-quick]} )) || return 2
if [[ $1 == up ]]; then
sudo wg-quick up $2
elif [[ $1 == down ]]; then
sudo wg-quick down $2
else
command wg "$@"
fi
}