/[packages]/updates/1/webmin/current/SOURCES/webmin.initscript
ViewVC logotype

Contents of /updates/1/webmin/current/SOURCES/webmin.initscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 101464 - (show annotations) (download)
Wed Jun 1 19:01:05 2011 UTC (12 years, 10 months ago) by schedbot
File size: 1816 byte(s)
SILENT: branch release 1
1 #!/bin/sh
2 #
3 # webmin Start Webmin remote administration tool. This script
4 # starts the Webmin server.
5 #
6 # chkconfig: 2345 90 20
7 #
8 # description: Webmin is a remote administration tool using web-browser
9 # processname: perl
10 # pidfile: /var/run/webmin/miniserv.pid
11 # config: /etc/webmin/miniserv.conf
12 # config: /etc/webmin/miniserv.users
13
14 ### BEGIN INIT INFO
15 # Provides: webmin
16 # Required-Start: $network
17 # Required-Stop: $network
18 # Default-Start: 2 3 4 5
19 # Short-Description: Webmin is a remote administration tool using web-browser
20 # Description: Start Webmin remote administration tool. This script
21 # starts the Webmin server.
22 ### END INIT INFO
23
24 . /etc/rc.d/init.d/functions
25
26 RETVAL=0
27
28 if [ ! -d /usr/share/webmin ] || [ ! -d /etc/webmin ] || [ ! -f /etc/webmin/start ] || [ ! -f /etc/webmin/stop ]; then
29 echo "Webmin installation failed, I can't go further."
30 RETVAL="-1"
31 fi
32
33 case "$1" in
34 start)
35 gprintf "Starting Webmin"
36 /etc/webmin/start
37 RETVAL=$?
38 [[ $RETVAL -eq 0 ]] && touch /var/lock/subsys/webmin
39 ;;
40 stop)
41 gprintf "Stopping Webmin"
42 /etc/webmin/stop
43 RETVAL=$?
44 [[ $RETVAL -eq 0 ]] && rm -f /var/lock/subsys/webmin
45 ;;
46 status)
47 if ! [ -f /var/run/webmin/miniserv.pid ] ; then
48 gprintf "miniserv.pl is stopped"
49 RETVAL=3
50 else
51 pid=`cat /var/run/webmin/miniserv.pid`
52 kill -0 $pid >/dev/null 2>&1
53 RETVAL=$?
54 if [ $RETVAL == 0 ] ; then
55 gprintf "miniserv.pl (pid %s) is running..." $pid
56 else
57 gprintf "miniserv.pl is stopped"
58 RETVAL=3
59 fi
60 fi
61 ;;
62 restart)
63 $0 stop
64 $0 start
65 ;;
66 reload)
67 $0 stop
68 $0 start
69 ;;
70 condrestart)
71 if [ -f /var/lock/subsys/webmin ]; then
72 $0 stop
73 $0 start
74 fi
75 ;;
76 *)
77 gprintf "Usage: %s {start|stop|status|restart|condrestart }" $0
78 RETVAL=1
79 ;;
80 esac
81 echo
82 exit $RETVAL

  ViewVC Help
Powered by ViewVC 1.1.30