#! /bin/bash active_conns=$(netstat -tun | grep -P "tcp.*:22 ") if [ "$active_conns" = "" ]; then echo -n else echo "#" fi