#!/bin/sh

# Quick and dirty shell script to run traceroutes towards four test sites of
# newly deployed IP address space
# James Hiebert <jamesmh@cs.uoregon.edu>
# 01.01.2007

data_file=./in_probe.dat
tr="traceroute -n -m 30 -I"

psg_ips="96.0.0.1 147.28.0.35"
linton_ips="97.64.46.1 202.8.44.44"
doering_ips="96.0.16.1 194.97.144.209"
iij_ips="96.0.32.2 210.130.133.54"

date > $data_file
hostname >> $data_file
whoami >> $data_file
ifconfig >> $data_file

echo "In probe towards PSG" >> $data_file
for ip in $psg_ips;
do
  $tr $ip >> $data_file
done

echo "In probe towards AS 23654" >> $data_file
for ip in $linton_ips;
do
  $tr $ip >> $data_file
done

echo "In probe towards greenie.net" >> $data_file
for ip in $doering_ips;
do
  $tr $ip >> $data_file
done

echo "In probe towards IIJ" >> $data_file
for ip in $iij_ips;
do
  $tr $ip >> $data_file
done

if ! cat $data_file | mail -s "in probe data file" jamesmh@cs.uoregon.edu; then
  echo "Data file successfully mailed to jamesmh@cs.uoregon.edu";
else
  echo "Mailing the data file failed!  Please e-mail '$data_file' to jamesmh@cs.uoregon.edu";
fi
