feat: add script for simple wg vpn management

This commit is contained in:
janishutz committed 2026-10-05 17:18:33 +02:00
1 parent 6f68856d35
commit 4eb93884c8
1 file changed
+15
Executable
+15
View File
@@ -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