]> git.pld-linux.org Git - packages/coda.git/blob - coda.update.init
- dropped pre-cvs changelog
[packages/coda.git] / coda.update.init
1 #!/bin/sh
2 #
3 # update
4 #
5 # chkconfig:    345 95 02
6 #
7 # description:  The Coda update server and clients
8 #
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12
13 # Get network config
14 . /etc/sysconfig/network
15
16 # Check that networking is up
17 if is_yes "${NETWORKING}"; then
18         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19                 msg_network_down update
20                 exit 1
21         fi
22 else
23         exit 0
24 fi
25
26 RETVAL=0
27 case "$1" in
28   start)
29         # Check if the service is already running?
30         if [ ! -f /var/lock/subsys/update ]; then
31                 msg_starting rpc2portmap
32                 daemon rpc2portmap
33                 RETVAL=$?
34                 msg_starting updatesrv
35                 daemon updatesrv
36                 RET=$?
37                 [ RETVAL -eq 0 ] && RETVAL=$RET
38                 msg_starting updateclnt
39                 daemon updateclnt -h `cat /var/lib/vice/db/scm`
40                 RET=$?
41                 if [ RETVAL -eq 0 ] && RETVAL=$RET
42                 [ RETVAL -eq 0 ] && touch /var/lock/subsys/update
43         else
44                 msg_already_running update
45         fi
46         ;;
47   stop)
48         if [ -f /var/lock/subsys/update ]; then
49                 msg_stopping updateclnt
50                 killproc updateclnt
51                 msg_stopping updatesrv
52                 killproc updatesrv
53                 msg_stopping rpc2portmap
54                 killproc rpc2portmap
55                 rm -f /var/lock/subsys/update
56         else
57                 msg_not_running update
58         fi
59         ;;
60   status)
61         ;;
62   restart|force-reload)
63         $0 stop
64         $0 start
65         exit $?
66         ;;
67   *)
68         msg_usage "$0 {start|stop|restart|force-reload|status}"
69         exit 3
70         ;;
71 esac
72
73 exit $RETVAL
This page took 0.067336 seconds and 3 git commands to generate.