Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > c601f28fd25df465cb0da98abedccbbb > files > 43

webmin-1.180-1mdk.src.rpm

#!/bin/sh
#
# webmin        Start Webmin remote administration tool. This script
#               starts the Webmin server.
#
# chkconfig: 2345 90 20
#
# description: Webmin is a remote administration tool using web-browser
# processname: perl
# pidfile: /var/run/webmin/miniserv.pid
# config: /etc/webmin/miniserv.conf
# config: /etc/webmin/miniserv.users

. /etc/rc.d/init.d/functions

if [ ! -d /usr/share/webmin ] || [ ! -d /etc/webmin ] || [ ! -f /etc/webmin/start ] || [ ! -f /etc/webmin/stop ]; then
    echo "Webmin installation failed, I can't go further."
    exit -1
fi
 
case "$1" in
  start)
	action "Starting Webmin" /etc/webmin/start
	[ $? -eq 0 ] && touch /var/lock/subsys/webmin
	;;
  stop)
	action "Stopping Webmin" /etc/webmin/stop
	[ $? -eq 0 ] && rm -f /var/lock/subsys/webmin
	;;
  status)
	if ! [ -f /var/run/webmin/miniserv.pid ]
	then echo "miniserv.pl is stopped"
	     exit 3
	fi
	pid=`cat /var/run/webmin/miniserv.pid`
	kill -0 $pid >/dev/null 2>&1
	if [ $? == 0 ] 
	then echo "miniserv.pl (pid $pid) is running..."
	     exit 0
	fi
	echo "miniserv.pl is stopped"
	exit 3
	;;
  restart)
  	$0 stop
	$0 start
	;;
  reload)
  	$0 stop
	$0 start
	;;
  condrestart)
       if [ -f /var/lock/subsys/webmin ]; then
	    $0 stop
	    $0 start
	fi
	;;
*)
	echo "Usage: $0 { start | stop | status | restart | condrestart }"
	exit 1
	;;
esac
exit 0