Slide 11
Slide 11 text
comm_test.sh
#!/usr/bin/env bash
test_connection () {
# fork a subshell to handle the tcp connect test
( # the result is either no-response or conn-refused
result=$(nmap -P0 -T1 -sT -p22 --reason -q $4 | awk '/^22/{print $4}')
echo "$1 $2 $3 $4 $result $8 $9" >> results.txt
) &
}
# connect to the gps receiver host and monitor real-time UDP gps updates
ssh -t gps001.iad1.prod.rws 'tail -F gps_updates.csv' | while read line ; do
# line format: Jun 16 15:14:45, 184.251.233.91, 0, 20, 2577, \
# 33.9822566666667, -118.4593
line=$(echo $line | tr -d ',')
test_connection $line
done