- cleaning
[packages/davfs.git] / davfs.init
1 # $Revision$, $Date$
2 #!/bin/sh
3 #
4 # davfsd                davfsd (WEB-DAV Linux File System)
5 #
6 # chkconfig:    345 35 65
7 #
8 # description:  davfsd is a server part of the WEB-DAV Linux File System
9 #
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config
19 [ -f /etc/sysconfig/davfsd ] && . /etc/sysconfig/davfsd
20
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23         if [ ! -f /var/lock/subsys/network ]; then
24                 msg_network_down davfsd
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31
32 # See how we were called.
33 case "$1" in
34   start)
35         # Check if the service is already running?
36         if [ ! -f /var/lock/subsys/davfsd ]; then
37                 msg_starting davfsd
38                 daemon /usr/sbin/davfsd
39                 RETVAL=$?
40                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/davfsd
41         else
42                 msg_already_running davfsd
43                 exit 1
44         fi
45         ;;
46   stop)
47         if [ -f /var/lock/subsys/davfsd ]; then
48                 msg_stopping davfsd
49                 killproc davfsd
50                 rm -f /var/run/davfsd.pid /var/lock/subsys/davfsd >/dev/null 2>&1
51         else
52                 msg_not_running davfsd
53                 exit 1
54         fi
55         ;;
56   restart)
57         $0 stop
58         $0 start
59         ;;
60   status)
61         status davfsd
62         exit $?
63         ;;
64   reload)
65         msg_reloading davfsd
66         busy
67         killproc davfsd -HUP
68         RETVAL=$?
69         [ $RETVAL -eq 0 ] && ok || died
70         ;;
71   *)
72         msg_usage "$0 {start|stop|init|restart|reload|status}"
73         exit 1
74 esac
75
76 exit $RETVAL
This page took 0.060054 seconds and 3 git commands to generate.