Gentoo Archives: gentoo-commits

From: "Michael Weber (xmw)" <xmw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/radvd/files: radvd-1.9.1.init
Date: Fri, 29 Jun 2012 08:10:02
Message-Id: 20120629080952.54EE72004B@flycatcher.gentoo.org
1 xmw 12/06/29 08:09:52
2
3 Added: radvd-1.9.1.init
4 Log:
5 Version bump (thanks euscan), improve config-check in initd
6
7 (Portage version: 2.1.11.3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-misc/radvd/files/radvd-1.9.1.init
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/radvd/files/radvd-1.9.1.init?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/radvd/files/radvd-1.9.1.init?rev=1.1&content-type=text/plain
14
15 Index: radvd-1.9.1.init
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2012 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd-1.9.1.init,v 1.1 2012/06/29 08:09:52 xmw Exp $
21
22 CONFIGFILE=/etc/radvd.conf
23 PIDFILE=/var/run/radvd/radvd.pid
24 SYSCTL_FORWARD=net.ipv6.conf.all.forwarding
25
26 extra_started_commands="reload"
27
28 depend() {
29 need net
30 }
31
32 checkconfig() {
33 if [ ! -f "${CONFIGFILE}" ]; then
34 eerror "Configuration file ${CONFIGFILE} not found"
35 return 1
36 fi
37
38 if ! /usr/sbin/radvd -c -C "${CONFIGFILE}" ; then
39 eerror "Configuration file ${CONFIGFILE} failed test"
40 return 1
41 fi
42
43 checkpath -d -o radvd:radvd ${PIDFILE%/*}
44 }
45
46 start() {
47 checkconfig || return 1
48
49 if [ "${FORWARD}" != "no" ]; then
50 ebegin "Enabling IPv6 forwarding"
51 sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
52 eend $?
53 fi
54
55 ebegin "Starting IPv6 Router Advertisement Daemon"
56 start-stop-daemon --start --exec /usr/sbin/radvd \
57 --pidfile "${PIDFILE}" \
58 -- -C "${CONFIGFILE}" -p "${PIDFILE}" -u radvd ${OPTIONS}
59 eend $?
60 }
61
62 stop() {
63 ebegin "Stopping IPv6 Router Advertisement Daemon"
64 start-stop-daemon --stop --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
65 eend $?
66
67 if [ "${FORWARD}" != "no" ]; then
68 ebegin "Disabling IPv6 forwarding"
69 sysctl -w "${SYSCTL_FORWARD}=0" > /dev/null
70 eend $?
71 fi
72 }
73
74 reload() {
75 checkconfig || return 1
76
77 if [ "${FORWARD}" != "no" ]; then
78 ebegin "Enabling IPv6 forwarding"
79 sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
80 eend $?
81 fi
82
83 ebegin "Reloading IPv6 Router Advertisement Daemon"
84 start-stop-daemon --signal HUP \
85 --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
86 eend $?
87 }