style: vpn func
This commit is contained in:
parent
357170edcd
commit
190a4d8ab1
@ -169,9 +169,11 @@ vpn() {
|
|||||||
|
|
||||||
test -e "$CONFIGFILE" || (echo "Config '$CONFIGFILE' not exists" >&2; return 1) && (
|
test -e "$CONFIGFILE" || (echo "Config '$CONFIGFILE' not exists" >&2; return 1) && (
|
||||||
|
|
||||||
SERVICE="wg-quick@$CONFIG.service"
|
SERVICE="wg-quick@$CONFIG.service"
|
||||||
|
|
||||||
systemctl --quiet is-active "$SERVICE" && sudo systemctl stop "$SERVICE" || sudo systemctl start "$SERVICE"
|
systemctl --quiet is-active "$SERVICE" && \
|
||||||
|
(sudo systemctl stop "$SERVICE" && echo DOWN) || \
|
||||||
|
(sudo systemctl start "$SERVICE" && ip -br a | grep wg0 | awk '{print $1":\t"$3}')
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user