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.

Revisions

  1. worncitizen revised this gist Jan 22, 2013. 1 changed file with 10 additions and 12 deletions.
    22 changes: 10 additions & 12 deletions younameit.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    case $2 in
    *zalora*)
    zalora_uri=$2
    ;;
    ;;
    *)
    exit 2;
    ;;
    @@ -17,23 +17,21 @@ lookup_log=$logs_dir/lookup.log
    wget_log=$logs_dir/wget.log
    traceroute_log=$logs_dir/traceroute.log

    # Using host instead of nslookup (dig anyone?)
    (
    echo ">>>>>>>>>>>>>>>"
    date
    echo ">>>>> $(date) <<<<<"
    host $zalora_uri
    echo ">>>>>>>>>>>>>>>"
    ) >> $lookup_log
    ) >> $lookup_log 2>&1

    # Just retrieving a "small file"
    (
    echo ">>>>>>>>>>>>>>>"
    date
    echo ">>>>> $(date) <<<<<"
    wget -nv $zalora_uri/rev.txt -O $logs_dir/rev.txt
    echo ">>>>>>>>>>>>>>>"
    ) >> $wget_log
    ) >> $wget_log 2>&1

    # Using TCP SYN instead of ICMP ECHO here
    (
    echo ">>>>>>>>>>>>>>>"
    date
    echo ">>>>> $(date) <<<<<"
    traceroute -nT $zalora_uri
    echo ">>>>>>>>>>>>>>>"
    ) >> $traceroute_log
    ) >> $traceroute_log 2>&1
  2. worncitizen created this gist Jan 22, 2013.
    39 changes: 39 additions & 0 deletions younameit.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #!/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