mirror of
https://github.com/alrayyes/dotfiles/
synced 2023-11-14 15:56:30 +00:00
Added script to switch wireguard interfaces up/down
This commit is contained in:
parent
311f8cc5ee
commit
a4c3d9c57e
18
wireguard/.scripts/vpn-switch.sh
Executable file
18
wireguard/.scripts/vpn-switch.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
###
|
||||
# Switch wireguard vpns up/down
|
||||
###
|
||||
|
||||
STATUS="$(nmcli device status | grep -c wg0)"
|
||||
|
||||
case $STATUS in
|
||||
1)
|
||||
sudo wg-quick down wg0
|
||||
sudo wg-quick down wg1
|
||||
;;
|
||||
*)
|
||||
sudo wg-quick up wg0
|
||||
sudo wg-quick up wg1
|
||||
;;
|
||||
esac
|
Loading…
Reference in New Issue
Block a user