"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/tools/crash_pftp.sh" (8 Jul 2001, 372 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 # Crash FTP forwarding on Portfwd 0.13
    4 #
    5 # $1 = turns
    6 # $2 = delay
    7 
    8 do_fd_leak() {
    9 pftp -ni 127.0.0.1 10000 << __EOF__
   10 user everton nike=1T
   11 ls
   12 quit
   13 __EOF__
   14 }
   15 
   16 t=30
   17 [ -n "$1" ] && [ $1 -gt 0 ] && t=$1
   18 
   19 d=0
   20 [ -n "$2" ] && [ $2 -gt 0 ] && d=$2
   21 
   22 while [ $t -gt 0 ]; do
   23     echo "turns to go: $t"
   24     echo "sleeping $d seconds"
   25     sleep $d
   26     do_fd_leak
   27     t=$(($t - 1))
   28 done