#!/bin/bash # check process # if can parse the statement and watch the exit code if [ "$(ps -ef | grep -v grep | grep 2200:localhost:22)" ] 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