post_install() {
	if ! getent group ntp &>/dev/null; then
		groupadd -g 87 ntp >/dev/null
	fi
	if ! getent passwd ntp &>/dev/null; then
		useradd -u 87 -g ntp -G adm -d /var/lib/ntp -c 'Network Time Protocol' -s /bin/nologin ntp >/dev/null
	fi
	if ! groups ntp | grep adm &>/dev/null; then
		gpasswd -a ntp adm >/dev/null
	fi
	ntp_shell=$(getent passwd ntp | cut -d: -f7)
	if [ "$ntp_shell" != '/bin/nologin' ]; then
		chsh -s /bin/nologin ntp &>/dev/null
	fi
}

post_upgrade(){
	post_install
}

post_remove(){
	if getent passwd ntp &>/dev/null; then
		userdel ntp >/dev/null
	fi
	if getent group ntp &>/dev/null; then
		groupdel ntp >/dev/null
	fi
}
