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
1 changed files with 11 additions and 0 deletions

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
}