#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# 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 2000-06-01 13:02 EDT by <egudeniu@rubicon>.
# Source directory was `/work/rubicon/egudeniu/w300'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   2170 -rwxr-xr-x backend.dir/README
#   4037 -rwxr-xr-x backend.dir/apply
#    778 -rwxrwxrwx backend.dir/SunOS-5.6/ndd_fix.sh
#
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 mkdir _sh29868; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= backend.dir/README ==============
if test ! -d 'backend.dir'; then
  $echo 'x -' 'creating directory' 'backend.dir'
  mkdir 'backend.dir'
fi
if test -f 'backend.dir/README' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'backend.dir/README' '(file already exists)'
else
  $echo 'x -' extracting 'backend.dir/README' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'backend.dir/README' &&
Backend Patch
Copyright 2000, Network Associates Inc.
X
Backend Patch 1
This patch is intended for the following systems: 
X        WebShield 3XX
X
This patch addresses the following issues:
X
X        - When saving and applying changes to the NAT rules, backend errors will 
X          occur. 
X
APPLYING THE PATCH:
X
X    To apply the patch, place the .shar file into the /tmp directory. Next,
X    change into the /tmp directory and type: sh ./[PATCH NAME]
X    (where [PATCH NAME] is the name of the .shar file)
X
X    This will unshar the patch, and create a series of directories beneath
X    /tmp. Change into the directory named "backend.dir" and type: sh ./apply
X    This will install the patched files to the appropriate locations on your
X    system. For the patch to take effect, it will be necessary to reboot the
X    machine.
X
X    NOTE: Since the /tmp directory is for temporary files, it is advisable to
X    keep a copy of the patch file in another location on the filesystem. 
X    Otherwise, the patch file might be deleted once the system is rebooted.   
X
APPLYING THE PACKAGE:
X
X    To apply the package, place the tar file into the /tmp directory on the
X    Entrprise Workstation. Next, change into the root "/" directory and untar the
X    file using the following command: tar -xvf [PATCH NAME].tar. This will
X    create the package directory structure from which the Enterprise Workstation
X    can apply the package.
X
X    Open the Packages folder from the ESPM Workstation GUI. The newly added package 
X    should be visible. Highlight the package you are applying and select Actions->Apply
X    from the toolbar. A list of target hosts will be displayed, Select one that you
X    wish to apply the package to and select OK. Select OK once again when the package
X    has been succussfully installed. To verify that the packge properly installed, view 
X    the patchlog file on the target host, which is located at /usr/local/etc/mgmt.
X
X    NOTE: Since the /tmp directory is for temporary files, it is advisable to
X    keep a copy of the patch file in another location on the filesystem. 
X    Otherwise, the patch file might be deleted once the system is rebooted.   
SHAR_EOF
  chmod 0755 'backend.dir/README' ||
  $echo 'restore of' 'backend.dir/README' '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 'backend.dir/README:' 'MD5 check failed'
7ffc926f76c214bb80c7c020af8ceb91  backend.dir/README
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'backend.dir/README'`"
    test 2170 -eq "$shar_count" ||
    $echo 'backend.dir/README:' 'original size' '2170,' 'current size' "$shar_count!"
  fi
fi
# ============= backend.dir/apply ==============
if test -f 'backend.dir/apply' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'backend.dir/apply' '(file already exists)'
else
  $echo 'x -' extracting 'backend.dir/apply' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'backend.dir/apply' &&
#!/bin/sh
# Single Patch Apply Script
# Copyright 1998, Network Associates Inc.
X
# Your Patch Name Here:
PATCH_NAME=backend
X
# Your Patch Number Here:
PATCH_NO=1
X
# Your Patch Iteration Here (a, b, c etc.):
PATCH_NO_ITERATION=b
X
# Is this patch for a Gauntlet machine, or a GVPN machine?
# ("gauntlet", "gvpn", or "" if patch is for both)
FOR_MACHINE="gvpn"
X
# What version of Gauntlet/GVPN is this patch for?
# (leave this blank if it doesn't matter)
FOR_VERSION=5.5
X
PATCH_LOG=/usr/local/etc/mgmt/patchlog
PATCH_DATE=`date`
X
PLATFORM_NAME=`uname -s`
PLATFORM_VERSION=`uname -r`
X
PLATFORM=`echo $PLATFORM_NAME $PLATFORM_VERSION | tr " /" "--"`
X
#
# Make sure that the OS we are running on is valid for this
# patch.
#
if [ ! -d $PLATFORM ]; then
X    echo
X    echo "This update does not apply to your OS."
X    echo
X    exit 1
fi
X
#
# Make sure there is a Gauntlet installed.
#
if [ ! -f /usr/local/etc/mgmt/gauntlet.conf ]; then
X    echo 
X    echo "You don't appear to have a usable installation of Gauntlet."
X    echo "The file /usr/local/etc/mgmt/gauntlet.conf is missing."
X    echo
X    exit 1
fi
X
#
# For Gauntlet machines, or GVPN machines?
#
if [ "$FOR_MACHINE" = "gvpn" ] && [ ! -f /usr/local/etc/ikmpd ]; then
X    echo
X    echo "This update is for GVPN, which does not seem to be installed."
X    echo
X    exit 1
fi
if [ "$FOR_MACHINE" = "gauntlet" ] && [ -f /usr/local/etc/ikmpd ]; then
X    echo
X    echo "This update is for non-GVPN Gauntlet systems only."
X    echo
X    exit 1
fi
X
#
# Make sure this patch is OK for this version of Gauntlet or GVPN
#
#
if [ "$FOR_MACHINE" != "" ]; then 
X	VERSION_MATCH=`/usr/local/etc/$FOR_MACHINE-version | grep -i "$FOR_MACHINE.*$FOR_VERSION"`
else
X	if [ ! -f /usr/local/etc/ikmpd ]; then
X		VERSION_ONLY_MATCH=`/usr/local/etc/gauntlet-version | grep -i "gauntlet.*$FOR_VERSION"`
X		set $VERSION_ONLY_MATCH
X		VERSION_ONLY_MATCH=`echo $2`
X		if [ "$VERSION_ONLY_MATCH" = "V$FOR_VERSION" ]; then
X    			VERSION_MATCH="OK"
X		fi
X	else
X		if [ -f /usr/local/etc/ikmpd ]; then
X			VERSION_ONLY_MATCH=`/usr/local/etc/gvpn-version | grep -i "GVPN.*$FOR_VERSION"`
X			set $VERSION_ONLY_MATCH
X			VERSION_ONLY_MATCH=`echo $3`
X			if [ "$VERSION_ONLY_MATCH" = "V$FOR_VERSION" ]; then
X    				VERSION_MATCH="OK"
X			fi
X		fi
X	fi
fi
if [ "$VERSION_MATCH" = "" ]; then
X    echo
X    echo "This update is only intended for $FOR_MACHINE $FOR_VERSION."
X    echo
X    exit 1
fi 
X
#
# If the patch log file exists, then check the versions and for the existence 
# of the kernel patch. However, if the patch log file does not exist, inform
# the customer the kernel patch 1 must be applied before before continuing.
#
if [ -f $PATCH_LOG ]; then
X
X    LAST_PATCH=`grep " $PATCH_NAME.update " $PATCH_LOG | tail -1`
X
X    #
X    # If $LAST_PATCH is empty/null/void then a previous patch for this
X    # specific patch has not been installed.
X    #
X    if [ "$LAST_PATCH" != "" ]; then
X	LAST_NO=`echo $LAST_PATCH | cut -d" " -f3`
X	LAST_NO_ITERATION=`echo $LAST_PATCH | cut -d" " -f4`
X
X	if [ $LAST_NO -gt $PATCH_NO ]; then
X	    echo
X	    echo "A newer version of this update is already on the system."
X	    echo
X	    exit 1 
X	fi
X
X	if [ $LAST_NO -eq $PATCH_NO ]; then
X	    if [ `expr "X$LAST_NO_ITERATION" != "Xinstalled"` -ne 0 ]; then
X	        if [ `expr "X$LAST_NO_ITERATION" \> "X$PATCH_NO_ITERATION"` -ne 0 ]; then
X		    echo
X		    echo "A newer version of this update is already on the system."
X		    echo
X		    exit 1
X	        fi
X
X	        if [ `expr "X$LAST_NO_ITERATION" = "X$PATCH_NO_ITERATION"` -ne 0 ]; then
X		    echo
X		    echo "This update is already on the system."
X		    echo
X		    exit 1
X	        fi
X	    fi
X	fi
X    fi
fi
X
#
# Now we are ready to actually install the patch.
#
X
$PLATFORM/ndd_fix.sh
X
#
# Update the patchlog file.
#
echo "patch $PATCH_NAME.update $PATCH_NO $PATCH_NO_ITERATION installed $PATCH_DATE" >> $PATCH_LOG
X
X
# Now inform the user that the patch completed and that
# the system needs to be rebooted before the patched
# files will work.
#
echo
echo "Your system has been updated."
echo
X
Xexit 0
SHAR_EOF
  chmod 0755 'backend.dir/apply' ||
  $echo 'restore of' 'backend.dir/apply' '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 'backend.dir/apply:' 'MD5 check failed'
4e25068a2895f978f32a825bde25f0db  backend.dir/apply
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'backend.dir/apply'`"
    test 4037 -eq "$shar_count" ||
    $echo 'backend.dir/apply:' 'original size' '4037,' 'current size' "$shar_count!"
  fi
fi
# ============= backend.dir/SunOS-5.6/ndd_fix.sh ==============
if test ! -d 'backend.dir/SunOS-5.6'; then
  $echo 'x -' 'creating directory' 'backend.dir/SunOS-5.6'
  mkdir 'backend.dir/SunOS-5.6'
fi
if test -f 'backend.dir/SunOS-5.6/ndd_fix.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'backend.dir/SunOS-5.6/ndd_fix.sh' '(file already exists)'
else
  $echo 'x -' extracting 'backend.dir/SunOS-5.6/ndd_fix.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'backend.dir/SunOS-5.6/ndd_fix.sh' &&
#!/bin/sh
X
#MAIN
SRC="/etc/netstart"
DST="/etc/init.d/inetinit"
TMP="/tmp/netstart"
X
awk ' BEGIN { flag = 0}
/^# Performance Improment/ { flag=4; next;}
flag > 0 { flag--; next}
{ print $0 }
END { }' ${SRC} > ${TMP}; RET_VAL=$?;
X
if [ ${RET_VAL} -ne "0" ]; then
X   echo "Error "
X   exit 1;
else
X   rm -f ${SRC}
X   mv ${TMP} ${SRC}
X   chmod 750 ${SRC}
X   STR=`grep "WebShield 300" ${DST}`
X   if [ "${STR}" = "" ]; then
X      echo "" >> ${DST}
X      echo "# Performance Improment for WebShield 300" >> ${DST}
X      echo "ndd -set /dev/tcp tcp_xmit_hiwat 64000" >> ${DST}
X      echo "ndd -set /dev/tcp tcp_recv_hiwat 64000" >> ${DST}
X      echo "ndd -set /dev/tcp tcp_cwnd_max 524288" >> ${DST}
X      echo "ndd -set /dev/tcp tcp_fin_wait_2_flush_interval 60000" >> ${DST}
X   fi
fi
SHAR_EOF
  chmod 0777 'backend.dir/SunOS-5.6/ndd_fix.sh' ||
  $echo 'restore of' 'backend.dir/SunOS-5.6/ndd_fix.sh' '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 'backend.dir/SunOS-5.6/ndd_fix.sh:' 'MD5 check failed'
1bcb5801034667d125ee2a0b398910cc  backend.dir/SunOS-5.6/ndd_fix.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'backend.dir/SunOS-5.6/ndd_fix.sh'`"
    test 778 -eq "$shar_count" ||
    $echo 'backend.dir/SunOS-5.6/ndd_fix.sh:' 'original size' '778,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh29868
exit 0
