#!/bin/sh
killmodenone=0
justinstalled=1
if [ -d "/etc/usermin" ]; then
justinstalled=0
fi
inetd=`grep "^inetd=" /etc/usermin/miniserv.conf 2>/dev/null | sed -e 's/inetd=//g'`
productpidfile=`grep "^pidfile=" /etc/usermin/miniserv.conf 2>/dev/null | sed -e 's/pidfile=//g'`
if [ -r "$productpidfile" ]; then
productrunning=1
fi
if [ "$1" = "configure" ]; then
# Upgrading the package, so stop the old Webmin properly
if [ "$inetd" != "1" ]; then
if [ -f "/etc/usermin/.pre-install" ]; then
/etc/usermin/.pre-install >/dev/null 2>&1 $tempdir/usermin-setup.out 2>&1
if [ "usermin" = "webmin" ]; then
grep sudo= /etc/usermin/miniserv.conf >/dev/null 2>&1
if [ "$?" = 1 ]; then
# Allow sudo-based logins for Ubuntu
echo sudo=1 >>/etc/usermin/miniserv.conf
fi
fi
rm -f /var/lock/subsys/usermin
if [ "$inetd" != "1" ]; then
productucf=Webmin
if [ "usermin" = "usermin" ]; then
productucf=Usermin
fi
if [ "$justinstalled" = "1" ]; then
/etc/usermin/start >/dev/null 2>&1 /dev/null 2>&1 /dev/null 2>&1 /dev/null 2>&1 /dev/null 2>&1 /etc/usermin/uninstall.sh <