#! /bin/sh

set -e
umask 022

# See how we were called in detail
case "$1" in
	upgrade|install)
		# If we're upgrading, save the old settings from
		# /etc/init.d/nis so the postinst can substitute
		# them into the new /etc/default/nis config file.
		if [ ! -f /etc/default/nis ] && [ -f /etc/init.d/nis ]
		then
			grep "^NISSERVER=" /etc/init.d/nis \
				> /etc/default/nis.settings || true
		fi
		;;
	abort-upgrade)
		;;
	*)
		;;
esac

exit 0
