Create vpn-toggle

This commit is contained in:
2022-11-09 08:37:57 +07:00
committed by GitHub
parent cdb7053bf3
commit fef170d718
+19
View File
@@ -0,0 +1,19 @@
#! /bin/bash
VPN=$1
if [ -z "$VPN" ]
then
exit 1
fi
ACTIVE=`nmcli con show --active | grep "$VPN"`
if [ -z "$ACTIVE" ]
then
nmcli con up id "$VPN"
else
nmcli con down id "$VPN"
fi
exit 0