#!/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-03-21 14:33 EST by <rcalamba@rubicon>.
# Source directory was `/work/rubicon/rcalamba/5.6'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   3348 -rwxr-xr-x espminstallpkg.dir/apply
#   1049 -rwxr-x--- espminstallpkg.dir/README
#      0 -rw-rw-r-- espminstallpkg.dir/.F56RM0321a
#   1727 -rwxr-x--- espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.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 _sh20033; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= espminstallpkg.dir/apply ==============
if test ! -d 'espminstallpkg.dir'; then
  $echo 'x -' 'creating directory' 'espminstallpkg.dir'
  mkdir 'espminstallpkg.dir'
fi
if test -f 'espminstallpkg.dir/apply' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'espminstallpkg.dir/apply' '(file already exists)'
else
  $echo 'x -' extracting 'espminstallpkg.dir/apply' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'espminstallpkg.dir/apply' &&
#!/bin/sh
# Single Patch Apply Script
# Copyright 1998, Network Associates Inc.
X
# Your Patch Name Here:
PATCH_NAME=espminstallpkg
X
# Your Patch Number Here:
PATCH_NO=1
X
# Your Patch Iteration Here (a, b, c etc.):
PATCH_NO_ITERATION=a
X
# Is this patch for a Gauntlet machine, or a GVPN machine?
# ("gauntlet", "gvpn", or "" if patch is for both)
FOR_MACHINE=""
X
# What version of Gauntlet/GVPN is this patch for?
# (leave this blank if it doesn't matter)
FOR_VERSION=1.0
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 patch 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
#
# If the patch log file exists then check the versions, however, if
# the patch log file does not exist the assumption is that there have
# been no patches applied and any patches may be applied without need
# of checking versions.
#
if [ -f $PATCH_LOG ]; then
X    LAST_PATCH=`grep " $PATCH_NAME.patch " $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 patch 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 patch 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 patch 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
#
# Change to the directory for the specific platform that we
# are running upon.
#
cd $PLATFORM
X
#
# We need to perform the followin operations:
#
# 1) Move the files to be patched out of the way.
# 2) Copy the new file to the correct location.
#
for X in `find * -type f -print`; do
X    # 1) Move the existing files out of the way
X    if [ -f "/$X" ]; then
X	D=`dirname /$X`
X	B=`basename /$X`
X	if [ "$D" = "/etc/init.d" ]; then
X	    mv /$X /$D/PRE$PATCH_NO.$B.PRE$PATCH_NO
X	else
X	    mv /$X /$X.PRE$PATCH_NO
X	fi
X    fi
X
X    # 2) Copy the new file into place.
X    cp $X /$X
done
X
#
# Update the patchlog file.
#
echo "patch $PATCH_NAME.patch $PATCH_NO $PATCH_NO_ITERATION installed $PATCH_DATE" >> $PATCH_LOG
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 Gauntlet system must be rebooted to enable the"
echo "patch to take effect."
echo
Xexit 0
SHAR_EOF
  chmod 0755 'espminstallpkg.dir/apply' ||
  $echo 'restore of' 'espminstallpkg.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 'espminstallpkg.dir/apply:' 'MD5 check failed'
fce902d3c550dd575ace74b2793077dd  espminstallpkg.dir/apply
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'espminstallpkg.dir/apply'`"
    test 3348 -eq "$shar_count" ||
    $echo 'espminstallpkg.dir/apply:' 'original size' '3348,' 'current size' "$shar_count!"
  fi
fi
# ============= espminstallpkg.dir/README ==============
if test -f 'espminstallpkg.dir/README' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'espminstallpkg.dir/README' '(file already exists)'
else
  $echo 'x -' extracting 'espminstallpkg.dir/README' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'espminstallpkg.dir/README' &&
Script Patch
Copyright 1999, Network Associates Inc.
X
Script: run-backup
X
This patch is intended for the following systems: w300 Enterprise
X
This patch addresses the following issues:
X
X	-copying large files to a managed firewall when using the Package feature on the Enterprise GUI.
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 "http-gw.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 
SHAR_EOF
  chmod 0750 'espminstallpkg.dir/README' ||
  $echo 'restore of' 'espminstallpkg.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 'espminstallpkg.dir/README:' 'MD5 check failed'
cdd2ec6facd1da7bdaf50d42d349d3dc  espminstallpkg.dir/README
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'espminstallpkg.dir/README'`"
    test 1049 -eq "$shar_count" ||
    $echo 'espminstallpkg.dir/README:' 'original size' '1049,' 'current size' "$shar_count!"
  fi
fi
# ============= espminstallpkg.dir/.F56RM0321a ==============
if test -f 'espminstallpkg.dir/.F56RM0321a' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'espminstallpkg.dir/.F56RM0321a' '(file already exists)'
else
  $echo 'x -' extracting 'espminstallpkg.dir/.F56RM0321a' '(empty)'
  > 'espminstallpkg.dir/.F56RM0321a' &&
  chmod 0664 'espminstallpkg.dir/.F56RM0321a' ||
  $echo 'restore of' 'espminstallpkg.dir/.F56RM0321a' '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 'espminstallpkg.dir/.F56RM0321a:' 'MD5 check failed'
d41d8cd98f00b204e9800998ecf8427e  espminstallpkg.dir/.F56RM0321a
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'espminstallpkg.dir/.F56RM0321a'`"
    test 0 -eq "$shar_count" ||
    $echo 'espminstallpkg.dir/.F56RM0321a:' 'original size' '0,' 'current size' "$shar_count!"
  fi
fi
# ============= espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh ==============
if test ! -d 'espminstallpkg.dir/SunOS-5.6'; then
  $echo 'x -' 'creating directory' 'espminstallpkg.dir/SunOS-5.6'
  mkdir 'espminstallpkg.dir/SunOS-5.6'
fi
if test ! -d 'espminstallpkg.dir/SunOS-5.6/usr'; then
  $echo 'x -' 'creating directory' 'espminstallpkg.dir/SunOS-5.6/usr'
  mkdir 'espminstallpkg.dir/SunOS-5.6/usr'
fi
if test ! -d 'espminstallpkg.dir/SunOS-5.6/usr/local'; then
  $echo 'x -' 'creating directory' 'espminstallpkg.dir/SunOS-5.6/usr/local'
  mkdir 'espminstallpkg.dir/SunOS-5.6/usr/local'
fi
if test ! -d 'espminstallpkg.dir/SunOS-5.6/usr/local/etc'; then
  $echo 'x -' 'creating directory' 'espminstallpkg.dir/SunOS-5.6/usr/local/etc'
  mkdir 'espminstallpkg.dir/SunOS-5.6/usr/local/etc'
fi
if test ! -d 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws'; then
  $echo 'x -' 'creating directory' 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws'
  mkdir 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws'
fi
if test -f 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh' '(file already exists)'
else
  $echo 'x -' extracting 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh' &&
#!/bin/sh
# $Header: /projects/gauntlet/nspdev/V5.6.MAINT/projects/build/gather/../../gauntlet/root/./usr/local/etc/espmws/RCS/espminstallpkg.sh,v 1.6 2000/03/21 16:41:34 rcalamba Exp $
# install a package using the workstation
# args
#	pkgname 
X 
X. /usr/local/etc/espmws/espmrdcommon.inc
X
ESPMTMP="/tmp"
ESPMRPT="/tmp/espmcmdreport"
ESPMERR="/tmp/espmipkg"
X
if [ "$1" = "-rem" ]; then
X	shift
else
X	if [ "$2" = "" -a -f $ESPMWSD/${ID}selected ]; then
X		exec $0 $USERX $IDX -rem -rem "$1" `cat $ESPMWSD/${ID}selected`
X	fi
fi
X
if [ "$1" = "" ]; then
X	ERROR=1
else
X	PACKAGE=$1
X	shift
fi
X
PACKDIR=`echo "$PACKAGE" | sed s/'\.'pkg//` 
X
HOSTS="$*"
if [ "$HOSTS" = "" ]; then
X	ERROR=1
fi
X
if [ $ERROR -ne 0 ]; then
X	(echo "HTTP/1.0 400 Error#"; echo "#"; echo "Could not find required arguments.#")| tr "#" "\015"
X	exit 1
fi
X
(echo "HTTP/1.0 200 OK#"; echo "#")| tr "#" "\015"
for i in $HOSTS; do
X	# Get the OS of this host
X	$ESPMWS/espmgetver $i
X	read X < $ESPMTMP/ostypever.tmp
X	#put the file on the firewall
X	$ESPMC -h $i -p $PORT -k $ESPMWSD/$i/keyfile get -o /dev/null "/realgui/getauthconfirm;" get "/realgui/makepkgdir;" 2> $ESPMERR
X	if [ $? -ne 0 ]; then 
X		ERROR=1 
X	fi
X	$ESPMC -h $i -p $PORT -k $ESPMWSD/$i/keyfile get -o /dev/null "/realgui/getauthconfirm;" put -i $ESPMWSD/.packages./$PACKDIR/$X/$PACKAGE "/realgui/savepkg;" 2> $ESPMERR
X	if [ $? -ne 0 ]; then 
X		ERROR=1 
X	fi
X	$ESPMC -h $i -p $PORT -k $ESPMWSD/$i/keyfile get -o /dev/null "/realgui/getauthconfirm;" get "/realgui/installpkg;" 2> $ESPMERR
X	if [ $? -ne 0 ]; then 
X		ERROR=1 
X	fi
X	rm $ESPMTMP/ostypever.tmp
#	exit 1
X	if [ $ERROR -ne 0 ]; then
X		echo "Processing $i ERROR |" >> $ESPMRPT
X	else
X		echo "Processing $i OK |" >> $ESPMRPT
X	fi
done	
rm -f $ESPMERR
X
SHAR_EOF
  chmod 0750 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh' ||
  $echo 'restore of' 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.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 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh:' 'MD5 check failed'
305fca556ca322d3926949479275ba86  espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh'`"
    test 1727 -eq "$shar_count" ||
    $echo 'espminstallpkg.dir/SunOS-5.6/usr/local/etc/espmws/espminstallpkg.sh:' 'original size' '1727,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh20033
exit 0
