Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | #!/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 | |
| 28 | if [ -f /etc/sysconfig/mip6d ]; then |
| 29 | . /etc/sysconfig/mip6d |
| 30 | fi |
| 31 | |
| 32 | mip6d=/usr/sbin/mip6d |
| 33 | prog="mip6d" |
| 34 | lockfile=/var/lock/subsys/$prog |
| 35 | |
| 36 | start() { |
| 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 | |
| 46 | stop() { |
| 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 | |
| 55 | restart() { |
| 56 | stop |
| 57 | start |
| 58 | } |
| 59 | |
| 60 | reload() |
| 61 | { |
| 62 | echo -n $"Reloading $prog configuration: " |
| 63 | killproc $mip6d -HUP |
| 64 | retval=$? |
| 65 | echo |
| 66 | return $retval |
| 67 | } |
| 68 | |
| 69 | force_reload() { |
| 70 | restart |
| 71 | } |
| 72 | |
| 73 | rh_status() { |
| 74 | status $prog |
| 75 | } |
| 76 | |
| 77 | rh_status_q() { |
| 78 | rh_status > /dev/null 2>&1 |
| 79 | } |
| 80 | |
| 81 | case "$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 |
| 110 | esac |
| 111 | |
| 112 | exit $? |