Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] radvd: improve startup script
@ 2017-09-25  9:57 Carlos Santos
  2017-09-26 22:26 ` Arnout Vandecappelle
  0 siblings, 1 reply; 8+ messages in thread
From: Carlos Santos @ 2017-09-25  9:57 UTC (permalink / raw)
  To: buildroot

The previous script caused a failure if /etc/radvd.conf did not exist.

This is a simple copy/paste/edit of package/dnsmasq/S80dnsmasq.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/radvd/S50radvd | 36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/package/radvd/S50radvd b/package/radvd/S50radvd
index 9f1407c..dcc2af6 100755
--- a/package/radvd/S50radvd
+++ b/package/radvd/S50radvd
@@ -1,18 +1,26 @@
 #!/bin/sh
 
-RADVD=/usr/sbin/radvd
+[ -x /usr/sbin/radvd ] || exit 0
+[ -f /etc/radvd.conf ] || exit 0
 
-echo "1" > /proc/sys/net/ipv6/conf/all/forwarding
+case "$1" in
+	start)
+		printf "Starting radvd: "
+		start-stop-daemon -S -x /usr/sbin/radvd
+		[ $? = 0 ] && echo "OK" || echo "FAIL"
+		;;
+	stop)
+		printf "Stopping radvd: "
+		start-stop-daemon -K -q -x /usr/sbin/radvd
+		[ $? = 0 ] && echo "OK" || echo "FAIL"
+		;;
+	restart|reload)
+		$0 stop
+		$0 start
+		;;
+	*)
+		echo "Usage: $0 {start|stop|restart}"
+		exit 1
+esac
 
-printf "Starting radvd: "
-if [ ! -x "${RADVD}" ]; then
-	echo "missing"
-	exit 1
-fi
-
-if ${RADVD} ; then
-	echo "done"
-else
-	echo "failed"
-	exit 1
-fi
+exit 0
-- 
2.7.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-26  0:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-25  9:57 [Buildroot] [PATCH] radvd: improve startup script Carlos Santos
2017-09-26 22:26 ` Arnout Vandecappelle
2017-09-27  1:15   ` Carlos Santos
2017-09-27  2:16   ` [Buildroot] [PATCH v2]] " Carlos Santos
2017-10-07 21:31     ` Thomas Petazzoni
2018-04-16  2:10     ` [Buildroot] [PATCH v3] " Carlos Santos
2018-04-25 21:25       ` Thomas Petazzoni
2018-04-26  0:08         ` Carlos Santos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox