# arg 1:  the new package version

post_install() {
	cat <<EOM

--> Sample config files are installed with .sample extension.
--> Remember, these are *SAMPLE* config files.  You'll need to read
--> the documentation for more information on how to actually define
--> services, hosts, etc. to fit your particular needs.

EOM

	getent group nagios > /dev/null || groupadd -g 30 nagios > /dev/null
	getent passwd nagios > /dev/null || useradd -u 30 -g nagios -d /dev/null -s /bin/false nagios > /dev/null
}

post_upgrade() {
	cat <<EOM

--> When upgrading from Nagios 2.x,
--> please read Quickstart Installation Guide
--> at http://nagios.sourceforge.net/docs/3_0/upgrading.html

EOM

	post_install

	cat <<EOM
--> The effective user/group that Nagios runs as was changed from "nobody" to "nagios".
--> Please change "nagios_user" and "nagios_group" options in your configuration.
EOM

	find /var/nagios -user nobody -exec chown nagios.nagios {} \;
	if [ -f /var/log/nagios.log ]; then
	   chown nagios /var/log/nagios.log
	fi
}

