#!/sbin/sh
#########################################################################
# 									
#   File:	 decustomize
#   @(#) decustomize $Revision: 1.4 $ $Date: 93/02/26 09:06:04 $
#   Description: /etc/update decustomization script for HPXT-XDM fileset
# 
#########################################################################
#

PATH="/bin:/usr/bin:/etc:."
FILESET=HPXT-XDM


	#
	# first time $1 = architecture, $2="check"
	# second  time $1 = architecture 
	# 



if [ "`uname -r | cut -d"." -f 2`" = "10" ]
then
  exit 0
fi

if [ "`uname -r | cut -d"." -f 2`" = "11" ]
then
  exit 0
fi


 # don't de-install this file set in order not to undo eventual
 # XDM stuff from other HP divisions (or MIT)


if [ $# -eq 2 ]
then
  #
  # remove eventual floppy lines from Xstartup and Xreset
  #
  VUEDIRS="/usr/lib/X11/xdm"
  for VUEDIR in $VUEDIRS
  do
    XSTARTUP=$VUEDIR/Xstartup
    XRESET=$VUEDIR/Xreset
    FILES="$XSTARTUP $XRESET"

    for FILE in $FILES
    do
      if [ -f $FILE ]
      then
        grep '\-x /usr/bin/X11/700X/admin/.*mountfloppy' $FILE > /dev/null
        if [ $? -eq 0 ]
        then
	  sed '/mountfloppy/,/^fi/d' $FILE > $FILE.tmp
	  cp $FILE.tmp $FILE
	  rm $FILE.tmp
        fi
      fi

      if [ -f "$FILE.hpxt" ]
      then
	rm $FILE.hpxt
      fi
    done
  done

  echo
  echo "NOTE:    will not deinstall full fileset in order not to interfere"
  echo "         with XDM filesets from other HP divisions or 3rd parties"
  echo "         If this is not a problem you may want to"
  echo "         remove /usr/bin/X11/xdm and /usr/lib/X11/xdm manually."
  echo
  exit 1
fi


exit 0
