mirror of
https://github.com/10h30/endeavouros-i3wm-setup.git
synced 2026-07-11 10:45:54 +09:00
Create vpn-toggle
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user