post_install() {
	# create group
	if ! getent group ircd &>/dev/null; then
		groupadd -r ircd >/dev/null
	fi
	# create user
	if ! getent passwd ircd &>/dev/null; then
		useradd -r ircd -d /var/empty -g ircd -s /bin/nologin >/dev/null
	fi

	# show message
	echo "SSL is enabled by default, so you need to create pem files"
	echo "unrealircd.conf needs adjustments"
	echo "See also: https://www.unrealircd.org/docs/Main_Page"
}

post_upgrade() {
	post_install
}

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