feat: add script for simple wg vpn management
This commit is contained in:
1 file changed
+15
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $1 == "d" || $1 == "down" ]]; then
|
||||||
|
nmcli con down wg0
|
||||||
|
elif [[ $1 == "u" || $1 == "up" ]]; then
|
||||||
|
nmcli con up wg0
|
||||||
|
elif [[ $1 == "import" ]]; then
|
||||||
|
nmcli connection add type wireguard file /etc/wireguard/wg0.conf
|
||||||
|
else
|
||||||
|
if [[ $(nmcli con show --active | grep wg0 | grep wireguard) == "" ]]; then
|
||||||
|
nmcli con up wg0
|
||||||
|
else
|
||||||
|
nmcli con down wg0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
Reference in new issue
Block a user