mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-10-26 19:57:22 +08:00
clean history
This commit is contained in:
25
tests/examples/nocat/bin/nodog.sh
Executable file
25
tests/examples/nocat/bin/nodog.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
test "$1" = -h && { echo usage: "$0 [<start> [<stop> [<sleep>]]]" ; exit 1 ; }
|
||||
|
||||
start=${1:-1}
|
||||
stop=${2:-56}
|
||||
sleep=${3:-60}
|
||||
|
||||
test -f ~/lg.env && . ~/lg.env || . /etc/profile > /dev/null
|
||||
|
||||
f() { local start=${1:-1} stop=${2:-10}
|
||||
|
||||
i=$start ; while test $i -le $stop ; do
|
||||
echo -n "Captive_$i 10.8.0.$i "
|
||||
ping -qc1 -W3 10.8.0.$i > /dev/null && {
|
||||
echo | telnet 10.8.0.$i 5280 2> /dev/null &&
|
||||
echo nodog OK | color -green . ||
|
||||
echo nodog DOWN | color -yellow .
|
||||
} ||
|
||||
echo not responding | color -red .
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
}
|
||||
|
||||
repeat -C -d -n -s $sleep f $start $stop
|
||||
Reference in New Issue
Block a user