#! /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.30  30-Nov-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

# Save /etc/init.d/network if needed.
if [ -f /etc/init.d/network ]
then
	cp -a /etc/init.d/network /etc/init.d/network.saved
fi
if [ -f /etc/inittab ]
then
	cp -a /etc/inittab /etc/inittab.saved
fi

[ ! -f /etc/init.d/boot ] && exit 0
echo "Saving variables from /etc/init.d/boot .."
rm -f /etc/init.d/boot.vars
grep '^[A-Z]*=' /etc/init.d/boot | (
  while read line
  do
	var=`echo $line | sed 's/=.*$//'`
	echo "s!^$var=.*\$!$line!" >> /etc/init.d/boot.vars
  done
)
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 variable settings in /etc/init.d/boot will be saved even if you
install a new version of this file.

EOF
