Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 6b750e885ca57877339e557bab191157 > scriptlet

nut-0.45.4-1mdk.i586.rpm

PREIN

/bin/sh
# Create an UPS user. 
groupadd -r ups >/dev/null 2>&1 || :
useradd -M -r -g ups -d /var/state/ups -s "" -c "UPSD Daemon" -G tty,usb ups 2> /dev/null || true

PREUN

/bin/sh
# only do this if it is not an upgrade
if [ $1 = 0 ]; then service upsmon stop > /dev/null 2>/dev/null || :; /sbin/chkconfig --del upsmon; fi; 
if [ $1 -eq 0 ]
then 
   /sbin/chkconfig --del upsmon
   [ -f /etc/rc.d/init.d/upsmon ] && \
   	/etc/rc.d/init.d/upsmon stop
fi

POSTIN

/bin/sh
if [ $1 = 1 ]; then /sbin/chkconfig --add upsmon; else if [ -f /var/lock/subsys/upsmon ]; then service upsmon restart > /dev/null 2>/dev/null || : ; fi; fi; 
#/sbin/chkconfig --add upsmon
# restart server if this is an upgrade
if [ $1 -gt 1 ]
then
   [ -f /etc/rc.d/init.d/upsmon ] && \
   	/etc/rc.d/init.d/upsmon restart
fi

POSTUN

/bin/sh
# only do this if it is not an upgrade
if [ $1 -eq 0 ]
then
   userdel ups >/dev/null 2>&1 || :
   groupdel ups >/dev/null 2>&1 || :   
fi