Skip to content

Instantly share code, notes, and snippets.

@wparad
Created August 1, 2020 15:56
Show Gist options
  • Save wparad/3a1bed0e0455f0eab495d8e602bf8c39 to your computer and use it in GitHub Desktop.
Save wparad/3a1bed0e0455f0eab495d8e602bf8c39 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Assuming the VPN connection name is SeedBox
currentState=`nmcli connection | grep SeedBox | tr -s ' ' | cut -f4 -d' '`
if [ "${currentState}" = "--" ]
then
nmcli connection up SeedBox
else
nmcli connection down SeedBox
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment