PREUN
/bin/sh
if [ "$1" -eq "0" ]; then
if [ -e /usr/share/webmin/defaulttheme ]; then
if grep -q mandriva /usr/share/webmin/defaulttheme 2> /dev/null; then
rm -f /usr/share/webmin/defaulttheme
grep -Ev '^theme=mandriva$' /etc/webmin/config \
> /etc/webmin/config.new \
&& mv /etc/webmin/config.new \
/etc/webmin/config 2> /dev/null
grep -Ev '^preroot=mandriva$' /etc/webmin/miniserv.conf \
> /etc/webmin/miniserv.conf.new \
&& mv /etc/webmin/miniserv.conf.new \
/etc/webmin/miniserv.conf 2> /dev/null
fi
fi
fi
POSTIN
/bin/sh
if [ ! -e /usr/share/webmin/defaulttheme ]; then
echo 'mandriva' > /usr/share/webmin/defaulttheme
echo 'theme=mandriva' >> /etc/webmin/config
echo 'preroot=mandriva' >> /etc/webmin/miniserv.conf
if [ "$1" = "0" ]; then
if /etc/rc.d/init.d/webmin status >/dev/null 2>&1; then
/etc/rc.d/init.d/webmin restart
fi
fi
fi