Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export IFS=" ":$IFS
- if [ "$1" == "" ]; then
- echo "Usage: $0 <numero personale>"
- exit 1;
- fi
- ips=(10.$1.1.1 10.$1.1.2 10.$1.1.100 10.$1.2.3 10.$1.2.100 10.$1.3.1 10.$1.3.2 10.$1.3.4)
- for ip in ${ips[@]}; do
- echo -n "Pinging $ip... "
- ping -c 4 $ip > /dev/null
- if [[ $? != 0 ]]; then echo "Cannot ping $ip"; exit 1;
- else echo "OK"; fi
- echo -n "Route for $ip... "
- trace=`tracert $ip | awk '/ms/ {gsub(/\).*/, "", $0);gsub(/.*\(/, "", $0);print $0} '`
- for i in $trace; do echo -n "$i "; done
- echo
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement