if [ "$#" != 1 ]
then
echo "Usage: `basename $0` file"
exit $E_WRONG_ARGU
fi
PATCH_1=${PATCH#*://}
HOST=${PATCH_1%%/*}
/usr/sbin/traceroute -m 5 $HOST >>$tracelog 2>&1
if grep "unknown host" $tracelog >/dev/null 2>&1
then
echo "Couldn't locate $HOST..."
exit $E_NOT_LOCATE
fi
echo -n -e "The directory where the file is to be placed [/tmp]: "
read DIREC
if [ "$DIREC" = "" ]
then
DIREC="/tmp"
cd $DIREC
else
cd $DIREC
if [ "$?" != 0 ]
then
echo "$DIREC does not exist, placing in /tmp anyway"
DIREC="/tmp"
cd $DIREC
fi
fi
while :
do
wget -c $PATCH
[ "$?" -eq 0 ] && break
done
echo -n -e "remove the log file? [y...n]: "
read ANS
case $ANS in
y|Y) rm -rf $tracelog.$$ 2>/dev/null ;;
*) ;;
esac