diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-03-30 20:49:16 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-03-30 20:49:16 +0200 |
commit | df65dc89b428c8f66ee2203f4a14eb2592d89ee0 (patch) | |
tree | 30fe6378dbeb4f594099b2fc26e3037729d4dfeb /examples/var_service/fw | |
parent | d9503224c8a93a30b0c8627084b2744d3ee6f403 (diff) | |
download | busybox-w32-df65dc89b428c8f66ee2203f4a14eb2592d89ee0.tar.gz busybox-w32-df65dc89b428c8f66ee2203f4a14eb2592d89ee0.tar.bz2 busybox-w32-df65dc89b428c8f66ee2203f4a14eb2592d89ee0.zip |
examples/var_service: new example: dnsmasq service
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples/var_service/fw')
-rw-r--r-- | examples/var_service/fw/etc/dnsmasq_servers.conf | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/examples/var_service/fw/etc/dnsmasq_servers.conf b/examples/var_service/fw/etc/dnsmasq_servers.conf new file mode 100644 index 000000000..68313605f --- /dev/null +++ b/examples/var_service/fw/etc/dnsmasq_servers.conf | |||
@@ -0,0 +1,38 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | empty=true | ||
4 | |||
5 | prio=0 | ||
6 | i=0; while test "${if[$i]}"; do | ||
7 | test x"${dns_prio[$i]}" != x"" \ | ||
8 | && test "${dns_prio[$i]}" -gt "$prio" \ | ||
9 | && prio="${dns_prio[$i]}" | ||
10 | let i++; done | ||
11 | |||
12 | i=0; while test "${if[$i]}"; do | ||
13 | if test "${dnsmasq[$i]}"; then | ||
14 | for d in ${dnsmasq[$i]}; do | ||
15 | echo "$d" | ||
16 | empty=false | ||
17 | done | ||
18 | let i++; | ||
19 | continue | ||
20 | fi | ||
21 | # This iface has no dnsmasq-extended config. | ||
22 | # Use simple DNS names instead, if those exist. | ||
23 | for d in ${dns[$i]}; do | ||
24 | p="${dns_prio[$i]}" | ||
25 | test x"$p" == x"" && p=0 | ||
26 | test x"$p" == x"$prio" || continue | ||
27 | echo "server=$d" | ||
28 | empty=false | ||
29 | done | ||
30 | let i++; | ||
31 | done | ||
32 | |||
33 | # Use Google DNS servers if nothing else is configured | ||
34 | $empty && echo "server=8.8.8.8" | ||
35 | $empty && echo "server=8.8.4.4" | ||
36 | |||
37 | # SIGHUP: make dnsmasq reload config | ||
38 | sv h dnsmasq | ||