#!/bin/bash # check process ps -ef | grep -v grep | grep 2200:localhost:22 # if not found - equals to 1, start it if [ $? -eq 1 ] then ssh -f -N -R 2200:localhost:22 k2patel@71.245.248.138 echo "Process not running - Started" else echo “Process Running - do nothing” fi