#! /bin/sh
#
# debian.preinst
#		Saves the GMT setting from /etc/init.d/boot.
#		This should really be set from a seperate
#		configfile, like /etc/sysconfig.
#
# Version:	debian.preinst  1.10  07-Mar-1996  MvS.
#

# First see if we have a new enough version of dpkg.
dpkg --assert-support-predepends >/dev/null 2>&1
if [ $? != 0 ]
then
cat <<EOF
Your dpkg version does not support the "Pre-depends" field. Upgrade your
version of dpkg first (to 1.1.0 or later) and reinstall.
EOF
  echo -n "Press <enter> to exit.."
  read junk
  exit 1
fi

[ ! -f /etc/init.d/boot ] && exit 0
echo "Saving GMT setting from /etc/init.d/boot .."
GMTLINE="`grep '^GMT=' /etc/init.d/boot`"
[ "$GMTLINE" = "" ] && exit 0
if [ "$GMTLINE" != 'GMT="-u"' ]
then
	echo "$GMTLINE" > /tmp/boot.GMT
fi

cat <<EOF

Dpkg might ask you if you want the new configuration files in /etc/init.d.
This is generally a good idea, unless you have really changed any of these
files. The GMT setting in /etc/init.d/boot will be saved even if you
install a new version of this file.

Do NOT overwrite the "/etc/init.d/network" file with a new one EVER.

EOF
