summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Robbins <drobbins@gentoo.org>2001-02-20 22:01:48 +0000
committerDaniel Robbins <drobbins@gentoo.org>2001-02-20 22:01:48 +0000
commit152534c860699973f39065846a149fc91791d04a (patch)
tree708950865dcca5facb3b66d64d0032e93342a42e
parentnow with LVM beta 5 (diff)
downloadhistorical-152534c860699973f39065846a149fc91791d04a.tar.gz
historical-152534c860699973f39065846a149fc91791d04a.tar.bz2
historical-152534c860699973f39065846a149fc91791d04a.zip
little missing file :)
-rw-r--r--sys-apps/portage/files/1.5/bin/queryhost.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys-apps/portage/files/1.5/bin/queryhost.sh b/sys-apps/portage/files/1.5/bin/queryhost.sh
new file mode 100644
index 000000000000..61213f379f07
--- /dev/null
+++ b/sys-apps/portage/files/1.5/bin/queryhost.sh
@@ -0,0 +1,27 @@
+
+#!/bin/sh
+
+hping() {
+ host=`echo $1 | sed -e 's:.*\://::' -e 's:/.*::'`
+ result=`ping -c3 -q ${host} 2>/dev/null`
+ if [ -n "$result" ]
+ then
+ if [ -z "`echo $result | sed 's:.*0 packets received.*:N:'`" ]
+ then
+ result=`echo $result | sed -e "s:.*= [0-9|\.]*/::" -e "s:/[0-9|\.]* ms::" | awk '{ printf ("%04i\n",(atof $1)) }'`
+ echo $result $1
+ else
+ echo 9999 $1
+ fi
+ fi
+}
+pingall() {
+
+ for i in $1
+ do
+ hping $i
+ done
+}
+pingall "$1" | sort | sed -e "s:[0-9]* ::"
+#pingall "$1"
+