"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/tools/stress_onthefly_dns.sh" (8 Jul 2001, 303 Bytes) of package /linux/privat/old/portfwd-0.29.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /bin/sh
    2 #
    3 # $1 = turns
    4 # $2 = delay
    5 
    6 trigger_dns() {
    7 nc -n 127.0.0.1 2000 </dev/null >/dev/null
    8 }
    9 
   10 t=30
   11 [ -n "$1" ] && [ $1 -gt 0 ] && t=$1
   12 
   13 d=0
   14 [ -n "$2" ] && [ $2 -gt 0 ] && d=$2
   15 
   16 while [ $t -gt 0 ]; do
   17     echo "turns to go: $t"
   18     echo "sleeping $d seconds"
   19     sleep $d
   20     trigger_dns
   21     t=$(($t - 1))
   22 done