desperado618
MIS
I would like to write a script that will prompt the user to supply the source and destination ip address to the following command:
tcpdump -nni eth1 src host <SRC> dst host <DST>
Other switches will be used but this is in its simplest form.
I believe I know how to prompt for either src or dst but I cannot figure out how to prompt for both and then input both into tcpdump. Heres what I have
echo "Please enter source address .\b\c"
read src
if [ $src = "REG EXP FOR IP ADDRESSES" ; then
tcpdump -nni eth1 src host $src
else
echo "Please enter a valid Ip address"
fi
tcpdump -nni eth1 src host <SRC> dst host <DST>
Other switches will be used but this is in its simplest form.
I believe I know how to prompt for either src or dst but I cannot figure out how to prompt for both and then input both into tcpdump. Heres what I have
echo "Please enter source address .\b\c"
read src
if [ $src = "REG EXP FOR IP ADDRESSES" ; then
tcpdump -nni eth1 src host $src
else
echo "Please enter a valid Ip address"
fi