#!/bin/sh

set -e

case "${1}" in
	configure)
		if ! getent passwd ntpd > /dev/null 2>&1
		then
			adduser --quiet --system --group --no-create-home --home /var/run/openntpd ntpd
		fi

		# implemented since 20080406p-1. See #701204.
		touch /var/lib/openntpd/ntpd.drift
		chown ntpd. /var/lib/openntpd/ntpd.drift

		;;

	abort-upgrade|abort-remove|abort-deconfigure)

		;;

	*)
		echo "postinst called with unknown argument \`${1}'" >&2
		exit 1
		;;
esac

#DEBHELPER#

exit 0
