Sophie

Sophie

distrib > PLD > ac > amd64 > by-pkgid > acd1a486184bd033ca8213e358978eb4 > scriptlet

nagios-common-2.7-1.amd64.rpm

PREIN

/bin/sh
if [ "`getgid netsaint`" = "72" ]; then
	/usr/sbin/groupmod -n nagios netsaint
fi

 
 
if [ -n "`/usr/bin/getgid nagios`" ]; then 
	if [ "`/usr/bin/getgid nagios`" != "72" ]; then 
		echo "Error: group nagios doesn't have gid=72. Correct this before installing nagios." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group nagios GID=72." 
	/usr/sbin/groupadd -g 72 -r nagios 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : 
fi;
 
 
if [ -n "`/usr/bin/getgid nagios-data`" ]; then 
	if [ "`/usr/bin/getgid nagios-data`" != "147" ]; then 
		echo "Error: group nagios-data doesn't have gid=147. Correct this before installing nagios." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group nagios-data GID=147." 
	/usr/sbin/groupadd -g 147 -r nagios-data 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : 
fi;if [ -n "`id -u netsaint 2>/dev/null`" ] && [ "`id -u netsaint`" = "72" ]; then
	/usr/sbin/usermod -d /usr/lib64/nagios -l nagios -c "Nagios User" -G nagios-data netsaint
fi

 
 
 
if [ -n "`/bin/id -u nagios 2>/dev/null`" ]; then 
	if [ "`/bin/id -u nagios`" != "72" ]; then 
		echo "Error: user nagios doesn't have uid=72. Correct this before installing nagios." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding user nagios UID=72." 
	/usr/sbin/useradd \
		 \
		-u 72 \
		-r \
		-d /usr/lib64/nagios \
		-s /bin/false \
		-c "Nagios User"\
		-g nagios \
		 \
		-G nagios-data \
		nagios 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || : 
fi;

POSTUN

/bin/sh
if [ "$1" = "0" ]; then
	/usr/lib/rpm/user_group.sh user del nagios
	/usr/lib/rpm/user_group.sh group del nagios
	/usr/lib/rpm/user_group.sh group del nagios-data
fi