PREUN
/bin/sh
if [ "$1" = 0 ]; then
grep root=/usr/share/webmin /etc/webmin/miniserv.conf >/dev/null 2>&1
if [ "$?" = 0 ]; then
# RPM is being removed, and no new version of webmin
# has taken it's place. Stop the server
/etc/rc.d/init.d/webmin stop >/dev/null 2>&1
fi
fi
chkconfig --del webmin
POSTIN
/bin/sh
if [ "$1" != 1 ]; then
# Upgrading the RPM, so stop the old webmin properly
/etc/rc.d/init.d/webmin stop >/dev/null 2>&1
fi
# (gc) security fix: we test if we are in install
if [ -z "$DURING_INSTALL" ]; then
/usr/share/webmin/postinstall.sh
fi
chkconfig --add webmin
rm -f /var/lock/subsys/webmin
/etc/rc.d/init.d/webmin start > /dev/null 2>&1
POSTUN
/bin/sh
if [ "$1" = 0 ]; then
grep root=/usr/share/webmin /etc/webmin/miniserv.conf >/dev/null 2>&1
if [ "$?" = 0 ]; then
# RPM is being removed, and no new version of webmin
# has taken it's place. Delete the config files
rm -rf /etc/webmin /var/webmin
fi
fi