#!/bin/sh pid=$1 port=$2 if netstat -a | egrep "$port" > /tmp/SimOopenCloset$$ then if egrep TIME_WAIT /tmp/SimOopenCloset$$ >/dev/null then cat /tmp/SimOopenCloset$$ | awk -F" " '{print $1, $2, $7}' kill -USR1 $pid fi fi rm /tmp/SimOopenCloset$$