Subversion Repositories configs

Rev

Rev 192 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
192 - 1
#!/bin/sh
2
# chkconfig: 235 99 10
3
# description: web-based administration interface for Unix systems
4
#
5
### BEGIN INIT INFO
6
# Provides:          webmin
7
# Required-Start:    $local_fs $network $syslog
8
# Required-Stop:     $local_fs $network
9
# Default-Start:     2 3 4 5
10
# Default-Stop:      0 1 6
11
# Short-Description: web-based administration interface for Unix systems
12
# Description:       Webmin is a web-based interface for system administration
13
#                    for Unix. Using Webmin you can configure DNS, Samba, NFS,
14
#                    local/remote filesystems and more using your web browser.
15
### END INIT INFO
16
 
17
PATH=/sbin:/usr/sbin:/bin:/usr/bin
18
DESC="web-based administration interface for Unix systems"
19
NAME=Webmin
20
PIDFILE=/var/webmin/miniserv.pid
21
SCRIPTNAME=/etc/init.d/$NAME
22
START=/etc/webmin/start
23
STOP=/etc/webmin/stop
24
RELOAD=/etc/webmin/reload
25
LOCKFILE=/var/lock/subsys/webmin
26
CONFFILE=/etc/webmin/miniserv.conf
27
 
28
case "$1" in
29
start)
30
	$START >/dev/null 2>&1 </dev/null
31
	RETVAL=$?
32
	if [ "$RETVAL" = "0" ]; then
33
		touch $LOCKFILE >/dev/null 2>&1
34
	fi
35
	;;
36
stop)
37
	$STOP
38
	RETVAL=$?
39
	if [ "$RETVAL" = "0" ]; then
40
		rm -f $LOCKFILE
203 - 41
		pidfile=`grep "^pidfile=" $CONFFILE | sed -e 's/pidfile=//g'`
42
		if [ "$pidfile" = "" ]; then
43
			pidfile=$PIDFILE
44
		fi
45
		rm -f $pidfile
192 - 46
	fi
47
	;;
48
status)
49
	pidfile=`grep "^pidfile=" $CONFFILE | sed -e 's/pidfile=//g'`
50
	if [ "$pidfile" = "" ]; then
51
		pidfile=$PIDFILE
52
	fi
53
	if [ -s $pidfile ]; then
54
		pid=`cat $pidfile`
55
		kill -0 $pid >/dev/null 2>&1
56
		if [ "$?" = "0" ]; then
57
			echo "$NAME (pid $pid) is running"
58
			RETVAL=0
59
		else
60
			echo "$NAME is stopped"
61
			RETVAL=1
62
		fi
63
	else
64
		echo "$NAME is stopped"
65
		RETVAL=1
66
	fi
67
	;;
68
restart)
69
	$STOP ; $START
70
	RETVAL=$?
71
	;;
72
reload|force-reload)
73
	$RELOAD
74
	RETVAL=$?
75
	;;
76
*)
77
	echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" >&2
78
	RETVAL=1
79
	;;
80
esac
81
exit $RETVAL
82