Wednesday, December 28, 2011

BASH WHILE Loop: article 201107

Loop every 1 minute for 7 hours, provide a date stamp, listen for syslog traffic with TCPDUMP, put the output to screen.  This was to have a check running in a Putty screen so I could keep a manual check on syslog not feeding my appliance.

#!/bin/bash

COUNTER=0
while [ $COUNTER -lt 421 ]; do
           date
           tcpdump -i eth0 port 514 -c 3
           let COUNTER=COUNTER+1
           sleep 58
           clear
           sleep 1
done

.

No comments:

Post a Comment