#!/bin/ash
# sniffit wrapper 
# by M. Andreoli (C) 1999

#set -x

echo "sniffit wrapper."
echo
read -p "Enter device [eth0]: " device
read -p "Enter protocol [ALL]: " protocol 
read -p "Enter port [ALL]: " port 

read -p "Enter IP address [192.168.1.1]: " ip 
read -p "Take $ip as [t]arget, [s]ource [t]: " ty 




[ -z "$ip" ] && ip=192.168.1.1

[ -z "$device" ] && device=eth0

pro_spec="-P $protocol"
[ -z "$protocol" ] && pro_spec=

port_spec="-p $port"
[ -z "$protocol" ] && port_spec=

[ -z "$ty" ] && ty="t"
ip_spec="-$ty $ip"

set -x
sniffit -a -F $device $pro_spec $port_spec $ip_spec
