blob: ebd70a6ccae4d9591147f0fcc89ab7ce5da26508 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001#!/bin/sh
2#
3# mip6d Start script for the Mobile IPv6 daemon
4#
5# chkconfig: - 55 25
6# description: The mobile IPv6 daemon allows nodes to remain \
7# reachable while moving around in the IPv6 Internet.
8# processname: mip6d
9# config: /etc/mip6d.conf
10# config: /etc/sysconfig/mip6d
11#
12### BEGIN INIT INFO
13# Provides: mipv6-daemon
14# Required-Start: $local_fs $remote_fs $network $named
15# Required-Stop: $local_fs $remote_fs $network
16# Should-Start: $syslog
17# Should-Stop: $network $syslog
18# Default-Start:
19# Default-Stop: 0 1 6
20# Short-Description: Start and stop Mobile IPV6 daemon
21# Description: The mobile IPv6 daemon allows nodes to remain
22# reachable while moving around in the IPv6 Internet.
23### END INIT INFO
24
25# Source function library.
26. /etc/init.d/functions
27
28if [ -f /etc/sysconfig/mip6d ]; then
29 . /etc/sysconfig/mip6d
30fi
31
32mip6d=/usr/sbin/mip6d
33prog="mip6d"
34lockfile=/var/lock/subsys/$prog
35
36start() {
37 [ -x $mip6d ] || exit 5
38 echo -n $"Starting $prog: "
39 start-stop-daemon -S -x ${mip6d} && success || failure
40 retval=$?
41 echo
42 [ $retval -eq 0 ] && touch ${lockfile}
43 return $retval
44}
45
46stop() {
47 echo -n $"Stopping $prog: "
48 start-stop-daemon -K -x $mip6d
49 retval=$?
50 echo
51 [ $retval -eq 0 ] && rm -f ${lockfile}
52 return $retval
53}
54
55restart() {
56 stop
57 start
58}
59
60reload()
61{
62 echo -n $"Reloading $prog configuration: "
63 killproc $mip6d -HUP
64 retval=$?
65 echo
66 return $retval
67}
68
69force_reload() {
70 restart
71}
72
73rh_status() {
74 status $prog
75}
76
77rh_status_q() {
78 rh_status > /dev/null 2>&1
79}
80
81case "$1" in
82 start)
83 rh_status_q && exit 0
84 $1
85 ;;
86 stop)
87 rh_status_q || exit 0
88 $1
89 ;;
90 restart)
91 $1
92 ;;
93 reload)
94 rh_status_q || exit 7
95 $1
96 ;;
97 force-reload)
98 force_reload
99 ;;
100 status)
101 rh_status
102 ;;
103 condrestart|try-restart)
104 rh_status_q || exit 0
105 restart
106 ;;
107 *)
108 echo $"Usage: $prog {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
109 exit 2
110esac
111
112exit $?