#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2004-10-11 09:44 PDT by <root@esmfgw.nac.uci.edu>.
# Source directory was `/root/nbd/enbd'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    387 -rwxr-xr-x go
#    414 -rwxr-xr-x watcher
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh29830; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= go ==============
if test -f 'go' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'go' '(file already exists)'
else
  $echo 'x -' extracting 'go' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'go' &&
#!/bin/bash
set -x
X
host=192.168.20.12
X
case "$1" in
X	stop)
X		killall -v watcher
X		sleep 2
X		killall -v -9 packetpasser
X		sleep 2
X		killall -v -9 packetpasser
X		ps -ef | grep packetpasser
X		;;
X	start)
X		./watcher
X		#for i in `seq 1070 1072`
X		#do
X		#	/usr/local/etc/packetpasser $i $i $host &
X		#done
X		sleep 2
X		ps -ef | grep packetpasser
X		;;
X	restart)
X		$0 stop
X		$0 start
X		;;
esac
X
SHAR_EOF
  (set 20 04 09 29 16 43 16 'go'; eval "$shar_touch") &&
  chmod 0755 'go' ||
  $echo 'restore of' 'go' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'go:' 'MD5 check failed'
01c99941fb3667e9a18af0ec199841ed  go
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'go'`"
    test 387 -eq "$shar_count" ||
    $echo 'go:' 'original size' '387,' 'current size' "$shar_count!"
  fi
fi
# ============= watcher ==============
if test -f 'watcher' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'watcher' '(file already exists)'
else
  $echo 'x -' extracting 'watcher' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'watcher' &&
#!/bin/bash
X
host=192.168.20.12
X
# this time, if an individual packetpasser dies, we immediately restart it.
# It remains to be seen if there'll be busy port problems.
#
# 5052 was Not configured by the enbd package automatically.  5051 was.
# so it's possible 5052 is or is not actually required.
for port in $(seq 1100 1108) 5051 5052
do
X	while :
X	do
X		/usr/local/etc/packetpasser $port $port $host
X	done &
done
SHAR_EOF
  (set 20 04 09 29 17 31 52 'watcher'; eval "$shar_touch") &&
  chmod 0755 'watcher' ||
  $echo 'restore of' 'watcher' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'watcher:' 'MD5 check failed'
8b561d2f77221ae2f41f65e942f9886c  watcher
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'watcher'`"
    test 414 -eq "$shar_count" ||
    $echo 'watcher:' 'original size' '414,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh29830
exit 0
