]> git.llucax.com Git - z.facultad/75.43/tp2.git/commitdiff
* Fancy ping all con colorcitos :)
authorRicardo Markiewicz <gazer.arg@gmail.com>
Wed, 13 Jul 2005 03:22:05 +0000 (03:22 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Wed, 13 Jul 2005 03:22:05 +0000 (03:22 +0000)
pingall.sh [new file with mode: 0755]

diff --git a/pingall.sh b/pingall.sh
new file mode 100755 (executable)
index 0000000..d8d8657
--- /dev/null
@@ -0,0 +1,34 @@
+
+hosts='www.google.com.ar alf1 alf3 friends65 csi93 action1 action2 brigada34 
+brigada33 seinfeld2 trfs194 simpson10 trfs199 action10 trfs193 gazer.com.ar
+swat37 swat38 heman130 dukes196 dukes193 dukes194 simpsons2 simpsons1'
+
+# Comandos
+TPUT=/usr/bin/tput
+EXPR=/usr/bin/expr
+
+# Variables lindas
+RED=`$TPUT setaf 1`
+GREEN=`$TPUT setaf 2`
+NORMAL=`$TPUT op`
+COLS=`$TPUT cols`
+if [ -n "$COLS" ]; then
+       COL=`$EXPR $COLS - 8`
+else
+       COL=72
+fi
+END=`$TPUT hpa $COL`
+
+# Codigo Fancy
+for i in $hosts ; do
+       echo -n "Probando host $i ..."
+       ping -c 3 $i > /dev/null 2>&1
+       if [ "x$?" = "x0" ] ; then
+               echo "$END[$GREEN  ok  $NORMAL]"
+       else
+               echo "$END[$RED Down $NORMAL]"
+       fi
+done
+
+
+