Handle hostnames with upper-case letters
[webmin.git] / webmin-caldera-init
1 #!/bin/sh
2 # webmin        This shell script takes care of starting and stopping
3 #               webmin
4 #
5
6 # Source function library.
7 . /etc/rc.d/init.d/functions
8
9 NAME=miniserv
10 DAEMON=/usr/libexec/webmin/miniserv.pl
11
12 # Source networking configuration.
13 . /etc/sysconfig/network
14
15 # Check that networking is up.
16 [ ${NETWORKING} = "no" ] && exit 0
17
18 # check if the webmin conf file is present
19 [ -f /etc/webmin/miniserv.conf ] || exit 0
20
21 case "$1" in
22 start)
23     [ ! -e $SVIlock ] || exit 1
24     if [ -f /etc/webmin/miniserv.conf ]; then
25         echo -n "Starting $IDENT: "
26         ssd -S -n $NAME -x $DAEMON -- /etc/webmin/miniserv.conf 2>&1 >/dev/null
27         touch $SVIlock
28         echo "."
29     else
30         echo "$NAME not configured (in /etc/webmin/miniserv.conf): Skipped!"
31     fi
32     ;;
33
34 stop)
35     [ -e $SVIlock ] || exit 0
36     echo -n "Stopping $IDENT: "
37     ssd -K -p /var/run/miniserv.pid >/dev/null 2>&1 && echo -n "miniserv"
38     rm -f $SVIlock
39     echo "."
40     ;;
41
42 *)
43     echo "Usage: $0 {start|stop}"
44     exit 1
45 esac
46
47 exit 0
48