Setting tag util-vserver-pl-0.4-29
[util-vserver-pl.git] / sysv / vip6-autod
1 #!/bin/bash
2 #
3 # vip6-autod   assigns auto-discovered IPv6 addresses to guests
4 #
5 # chkconfig: 2345 99 01
6 # description: starts vip6-autod
7
8 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
9 test -e "$UTIL_VSERVER_VARS" || {
10     echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
11     exit 1
12 }
13 . "$UTIL_VSERVER_VARS"
14
15 LOCKFILE=vip6-autod
16 . "$_LIB_VSERVER_INIT_FUNCTIONS"
17
18 prog="vip6-autod"
19
20 function start()
21 {
22     _beginResult $"Starting $prog"
23     $__SBINDIR/$prog
24     _endResult $?
25     local retval=$?
26     test "$retval" -ne 0 || touch "$lockfile"
27     return $retval
28 }
29
30 function stop()
31 {
32     _beginResult $"Stopping $prog"
33     kill `cat $LOCALSTATEDIR/run/vip6-autod.pid` &>/dev/null
34     _endResult $?
35     local retval=$?
36     $_RM -f "$lockfile"
37     return $retval
38 }
39
40 function restart()
41 {
42     stop
43     start
44 }
45
46 case "$1" in
47     start|stop|restart) $1;;
48     reload)             ;;
49     condrestart)
50         test -f $lockfile && restart || :
51         ;;
52     status)
53         status $prog
54         ;;
55     *)
56         echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
57         exit 2
58         ;;
59 esac