#!/bin/bash if [ $1 = 'srv1' ]; then nmcli con up id VPN1 sshpass -p 'remotepassword' ssh remoteuser@192.168.2.20 nmcli con down id VPN1 fi