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.8.5.init
Date: Tue, 29 May 2012 13:39:38
Message-Id: 20120529133853.7F25B2004C@flycatcher.gentoo.org
1 xmw 12/05/29 13:38:53
2
3 Added: radvd-1.8.5.init
4 Log:
5 Revbump for new initd file (bug 417975, thanks Florian Steinel)
6
7 (Portage version: 2.1.10.63/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-misc/radvd/files/radvd-1.8.5.init
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/radvd/files/radvd-1.8.5.init?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/radvd/files/radvd-1.8.5.init?rev=1.1&content-type=text/plain
14
15 Index: radvd-1.8.5.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.8.5.init,v 1.1 2012/05/29 13:38:53 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 checkpath -d -o radvd:radvd ${PIDFILE%/*}
39 }
40
41 start() {
42 checkconfig || return 1
43
44 if [ "${FORWARD}" != "no" ]; then
45 ebegin "Enabling IPv6 forwarding"
46 sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
47 eend $?
48 fi
49
50 ebegin "Starting IPv6 Router Advertisement Daemon"
51 start-stop-daemon --start --exec /usr/sbin/radvd \
52 --pidfile "${PIDFILE}" \
53 -- -C "${CONFIGFILE}" -p "${PIDFILE}" -u radvd ${OPTIONS}
54 eend $?
55 }
56
57 stop() {
58 ebegin "Stopping IPv6 Router Advertisement Daemon"
59 start-stop-daemon --stop --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
60 eend $?
61
62 if [ "${FORWARD}" != "no" ]; then
63 ebegin "Disabling IPv6 forwarding"
64 sysctl -w "${SYSCTL_FORWARD}=0" > /dev/null
65 eend $?
66 fi
67 }
68
69 reload() {
70 checkconfig || return 1
71
72 if [ "${FORWARD}" != "no" ]; then
73 ebegin "Enabling IPv6 forwarding"
74 sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
75 eend $?
76 fi
77
78 ebegin "Reloading IPv6 Router Advertisement Daemon"
79 start-stop-daemon --signal HUP \
80 --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
81 eend $?
82 }