TCPKILL | Scripting mode – batch mode

TKILL_ID_SEM="/tmp/tcpkill.$(date +%s).$RANDOM"
test -f $TKILL_ID_SEM && rm -f $TKILL_ID_SEM 

tcpkill -9 host $DEAD_HOST > $TKILL_ID_SEM 2>/dev/null &



while [ $CNT -lt $CNTLIMIT ]; do

#    echo $TKILL_ID_SEM

    sleep 1

    test -f $TKILL_ID_SEM && rm -f $TKILL_ID_SEM && kill -9 $KILL_PID && exit 

    CNT = $[ $CNT + 1 ]

#    echo $CNT

kill -9 $KILL_PID

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.