Sophie

Sophie

distrib > PLD > ac > amd64 > by-pkgid > 10510f1e8282c4e81346e68d829671e3 > scriptlet

avahi-0.6.11-1.amd64.rpm

PREIN

/bin/sh

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

POSTIN

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

POSTUN

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