--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/postinst Tue Dec 28 14:55:50 2010 +0100
@@ -0,0 +1,41 @@
+#!/bin/sh
+# postinst script for nagios-plugin-exec
+#
+# see: dh_installdeb(1)
+
+set -e
+
+KEYSERVER="hkp://gpg-keyserver.de"
+KEYS="FC4FE9CF D23350D3 FEC5CC46 3CB53556 48D0359B";
+
+case "$1" in
+ configure)
+ if ! getent passwd nagios > /dev/null ; then
+ echo 'Adding system-user for nagios' 1>&2
+ adduser --system --group --quiet --home /var/log/nagios \
+ --no-create-home --disabled-login nagios
+ fi
+ # Create home directory install also fixes permissions.
+ install --directory --owner nagios --group nagios --mode 750 /var/log/nagios
+
+ # Importing public gpg keys.
+ su - nagios -c "gpg --quiet --keyserver $KEYSERVER --recv-keys $KEYS" -s /bin/sh
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument '$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+