#!/bin/bash live="UP" while [[ `ifconfig tun0 | grep $live` ]]; do if [[ `ifconfig tun0 | grep $live` ]]; then echo "Your VPN connection is $live"; else echo "please close apps" killall mat-gui; fi done