Sophie

Sophie

distrib > PLD > ac > amd64 > by-pkgid > 90dff74162655028d01571dafd17a1c4 > scriptlet

rwho-0.17-16.amd64.rpm

PREIN

/bin/sh

 
 
if [ -n "`/usr/bin/getgid rwhod`" ]; then 
	if [ "`/usr/bin/getgid rwhod`" != "174" ]; then 
		echo "Error: group rwhod doesn't have gid=174. Correct this before installing rwho." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group rwhod GID=174." 
	/usr/sbin/groupadd -g 174 -r rwhod 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group 
fi;
 
 
 
if [ -n "`/bin/id -u rwhod 2>/dev/null`" ]; then 
	if [ "`/bin/id -u rwhod`" != "174" ]; then 
		echo "Error: user rwhod doesn't have uid=174. Correct this before installing rwho." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding user rwhod UID=174." 
	/usr/sbin/useradd \
		 \
		-u 174 \
		-r \
		-d /usr/share/empty \
		-s /bin/false \
		-c "rwhod User"\
		-g rwhod \
		 \
		 \
		rwhod 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd 
fi;

PREUN

/bin/sh
if [ "$1" = "0" ]; then
	{
if [ -f /var/lock/subsys/rwhod ]; then
/sbin/service rwhod stop 1>&2 || :;
fi };	/sbin/chkconfig --del rwhod
fi

POSTIN

/bin/sh
/sbin/chkconfig --add rwhod
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/rwhod ] && . /etc/sysconfig/rwhod
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/rwhod ]; then
/sbin/service rwhod restart 1>&2 || :;
else
echo 'Run "/sbin/service rwhod start" to start rwhod server.'
fi
fi };

POSTUN

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