#!/bin/bash if $(nmcli -g GENERAL.STATE c s "${1}"|grep -q '\bactiv'); then echo "going down" nmcli connection down "${1}" else echo "going up" nmcli connection up "${1}" fi