From e65495ed876c6dc9ea0d8e1581a3c11f56693e76 Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Wed, 13 Jul 2005 03:22:05 +0000 Subject: [PATCH 1/1] * Fancy ping all con colorcitos :) --- pingall.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 pingall.sh diff --git a/pingall.sh b/pingall.sh new file mode 100755 index 0000000..d8d8657 --- /dev/null +++ b/pingall.sh @@ -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 + + + -- 2.43.0