Skip to content

Instantly share code, notes, and snippets.

@eticzon
Last active December 11, 2015 11:28
Show Gist options
  • Save eticzon/4593544 to your computer and use it in GitHub Desktop.
Save eticzon/4593544 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Some crude checks here ...
[[ $1 != "" && -d $1 ]] && logs_dir=$1 || exit 1
# And another ...
case $2 in
*zalora*)
zalora_uri=$2
;;
*)
exit 2;
;;
esac
lookup_log=$logs_dir/lookup.log
wget_log=$logs_dir/wget.log
traceroute_log=$logs_dir/traceroute.log
(
echo ">>>>>>>>>>>>>>>"
date
host $zalora_uri
echo ">>>>>>>>>>>>>>>"
) >> $lookup_log
(
echo ">>>>>>>>>>>>>>>"
date
wget -nv $zalora_uri/rev.txt -O $logs_dir/rev.txt
echo ">>>>>>>>>>>>>>>"
) >> $wget_log
(
echo ">>>>>>>>>>>>>>>"
date
traceroute -nT $zalora_uri
echo ">>>>>>>>>>>>>>>"
) >> $traceroute_log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment