Heyas,
i've just been testing my ping script, where i've added an array of urls to ping.
In generell it works, but regardless if i use the script or ping directly, i cannot ping microsoft at all.
File: ~/bin/p
So to me it looked like:
While the other urls in the array where pinged successfully.
However, microsoft is available:
Is that just me or others too?
Thanks
i've just been testing my ping script, where i've added an array of urls to ping.
In generell it works, but regardless if i use the script or ping directly, i cannot ping microsoft at all.
File: ~/bin/p
Code:
#!/bin/bash
rnd() { # MAX [ MIN=0 ]
# Returns a random number up to MAX,
# or if provided, between MIN and MAX.
[ -z $1 ] && echo "Usage: rnd MAXNUMBER [MINVALUE]" && \
return 1 || max=$1
[ -z $2 ] && min=0 || min=$2
rnd=$RANDOM
while [ $rnd -gt $max ] && [ ! $rnd -lt $min ]; do rnd=$(($RANDOM*$max/$RANDOM)) ; done
echo $rnd
}
urls=('web.de' 'google.com' 'microsoft.com' 'yahoo.com' 'redhat.com' 'ubuntu.com' )
ping -c1 ${urls[$(rnd 5)]}
Code:
~ $ p
PING microsoft.com (64.4.11.37) 56(84) bytes of data.
--- microsoft.com ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
✘ ~ $
However, microsoft is available:
Code:
✘ ~ $ dig microsoft.com
; <<>> DiG 9.9.2-rl.028.23-P2-RedHat-9.9.2-7.P2.fc17 <<>> microsoft.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16925
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;microsoft.com. IN A
;; ANSWER SECTION:
microsoft.com. 1137 IN A 64.4.11.37
microsoft.com. 1137 IN A 65.55.58.201
;; Query time: 20 msec
;; SERVER: 62.2.17.61#53(62.2.17.61)
;; WHEN: Sat May 4 05:28:59 2013
;; MSG SIZE rcvd: 63
+ ~ $
Thanks