freebsd-ports/net-mgmt/pnp/files/pkg-install.in
Edwin Groothuis fb1f0fb885 New port: net-mgmt/pnp, modern graphing tool for Nagios
After evaluation of net-mgmt/nagiosgraph I decided to search for
	something more useful -- Nagios Graph was too hackish and unpretty for
	my taste. Digging through Nagios sites I had found PNP and was pleased
	by its simplicity and power.

	WWW: http://www.pnp4nagios.org/pnp/start

PR:		ports/126576
Submitted by:	Eygene Ryabinkin <rea-fbsd@codelabs.ru>
2008-08-17 06:49:35 +00:00

35 lines
633 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
PNP_RRDS=%%PNP_RRDS%%
PNP_SPOOL=%%PNP_SPOOL%%
NAGIOSUSER=%%NAGIOSUSER%%
NAGIOSGROUP=%%NAGIOSGROUP%%
dirs () {
for i in "$PNP_RRDS" "$PNP_SPOOL"; do
if ! [ -d "$i" ]; then
mkdir -p "$i"
chmod 750 "$i"
chown "$NAGIOSUSER":"$NAGIOSGROUP" "$i"
fi
done
}
check_sanity () {
if ! pw group show "$NAGIOSGROUP" 2>&1 > /dev/null; then
echo "No group '$NAGIOSGROUP'. Create it and try again."
exit 1
fi
if ! pw user show "$NAGIOSUSER" 2>&1 > /dev/null; then
echo "No user '$NAGIOSUSER'. Create it and try again."
exit 1
fi
}
if [ "x$2" = "xPOST-INSTALL" ]; then
check_sanity
dirs
fi