File tree Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 1- inherit : [cpackage, make, install]
1+ inherit : [cpackage, make, install, init ]
22
33metaEnvironment :
44 PKG_VERSION : " 2.90"
@@ -31,4 +31,10 @@ buildScript: |
3131 # required at runtime:
3232 mkdir -p install/var/lib/misc
3333
34+ # add init script
35+ if initIsAnySysvinit; then
36+ install -D -m 0755 $<@dnsmasq/S80dnsmasq.sh@> \
37+ install/etc/init.d/S80dnsmasq.sh
38+ fi
39+
3440packageScript : installPackageTgt "$1/install/"
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # This file comes from buildroot and is licensed under GPLv2.
4+
5+ DAEMON=" dnsmasq"
6+ PIDFILE=" /var/run/$DAEMON .pid"
7+
8+ [ -f /etc/dnsmasq.conf ] || exit 0
9+
10+ case " $1 " in
11+ start)
12+ printf " Starting dnsmasq: "
13+ start-stop-daemon -S -p " $PIDFILE " -x " /usr/sbin/$DAEMON " -- \
14+ --pid-file=" $PIDFILE "
15+ # shellcheck disable=SC2181
16+ [ $? = 0 ] && echo " OK" || echo " FAIL"
17+ ;;
18+ stop)
19+ printf " Stopping dnsmasq: "
20+ start-stop-daemon -K -q -p " $PIDFILE " -x " /usr/sbin/$DAEMON "
21+ # shellcheck disable=SC2181
22+ [ $? = 0 ] && echo " OK" || echo " FAIL"
23+ # wait for dnsmasq process to be gone
24+ while true ; do
25+ pid=" $( cat " ${PIDFILE} " 2> /dev/null || true ) "
26+ { [ -n " ${pid} " ] && [ -d " /proc/${pid} " ]; } || break
27+ sleep 0.1
28+ done
29+ rm -f " $PIDFILE "
30+ ;;
31+ restart|reload)
32+ $0 stop
33+ $0 start
34+ ;;
35+ * )
36+ echo " Usage: $0 {start|stop|restart}"
37+ exit 1
38+ esac
39+
40+ exit 0
You can’t perform that action at this time.
0 commit comments