]> git.pld-linux.org Git - packages/coda.git/blame - coda.update.init
- typo / formatting / etc.
[packages/coda.git] / coda.update.init
CommitLineData
bf7542bc 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
fde3a400 17if is_yes "${NETWORKING}"; then
21f06a93 18 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
fde3a400 19 msg_network_down update
20 exit 1
21 fi
22else
23 exit 0
bf7542bc 24fi
25
5a8a8a34 26RETVAL=0
bf7542bc 27case "$1" in
a61a406d 28 start)
29 # Check if the service is already running?
5a8a8a34 30 if [ ! -f /var/lock/subsys/update ]; then
a61a406d 31 msg_starting rpc2portmap
32 daemon rpc2portmap
5a8a8a34 33 RETVAL=$?
a61a406d 34 msg_starting updatesrv
35 daemon updatesrv
a9e8e25e 36 RET=$?
37 [ RETVAL -eq 0 ] && RETVAL=$RET
a61a406d 38 msg_starting updateclnt
39 daemon updateclnt -h `cat /var/lib/vice/db/scm`
a9e8e25e 40 RET=$?
41 if [ RETVAL -eq 0 ] && RETVAL=$RET
a61a406d 42 [ RETVAL -eq 0 ] && touch /var/lock/subsys/update
5a8a8a34 43 else
44 msg_already_running update
bf7542bc 45 fi
a61a406d 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
bf7542bc 56 else
a61a406d 57 msg_not_running update
bf7542bc 58 fi
a61a406d 59 ;;
60 status)
61 ;;
5a8a8a34 62 restart|force-reload)
a61a406d 63 $0 stop
bf7542bc 64 $0 start
5a8a8a34 65 exit $?
a61a406d 66 ;;
67 *)
5a8a8a34 68 msg_usage "$0 {start|stop|restart|force-reload|status}"
69 exit 3
bf7542bc 70 ;;
71esac
72
73exit $RETVAL
This page took 0.029822 seconds and 4 git commands to generate.