Sophie

Sophie

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

snort-2.4.5-3.amd64.rpm

PREIN

/bin/sh

 
 
if [ -n "`/usr/bin/getgid snort`" ]; then 
	if [ "`/usr/bin/getgid snort`" != "46" ]; then 
		echo "Error: group snort doesn't have gid=46. Correct this before installing snort." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group snort GID=46." 
	/usr/sbin/groupadd -g 46 -r snort 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : 
fi;
 
 
 
if [ -n "`/bin/id -u snort 2>/dev/null`" ]; then 
	if [ "`/bin/id -u snort`" != "46" ]; then 
		echo "Error: user snort doesn't have uid=46. Correct this before installing snort." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding user snort UID=46." 
	/usr/sbin/useradd \
		 \
		-u 46 \
		-r \
		-d /var/log/snort \
		-s /bin/false \
		-c "SNORT IDS/IPS"\
		-g snort \
		-M \
		 \
		snort 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/snort ]; then
/sbin/service snort stop 1>&2 || :;
fi };	/sbin/chkconfig --del snort
fi

POSTIN

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

POSTUN

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