add func vpn to toggle wireguard vpn
This commit is contained in:
parent
574d8827c3
commit
2f49aa7b3b
@ -151,3 +151,10 @@ py() {
|
|||||||
test -z "$@" && ipython -i -c "q = exit" || python3 $@
|
test -z "$@" && ipython -i -c "q = exit" || python3 $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vpn() {
|
||||||
|
local STATUS SERVICE
|
||||||
|
SERVICE="wg-quick@wg0.service"
|
||||||
|
STATUS=$(systemctl status $SERVICE | grep Active | awk -F ": " '{printf $2}' | awk -F " " '{printf $1}')
|
||||||
|
test $STATUS = "inactive" && sudo systemctl start $SERVICE || sudo systemctl stop $SERVICE
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user