gluon-mesh-batman-adv: add DNS support

This commit is contained in:
Matthias Schiffer 2014-01-21 03:59:15 +01:00
parent 1ceb38ac26
commit e57e88ee6c
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1 @@
/var/gluon/mesh-batman-adv/dnsmasq.conf

View File

@ -26,6 +26,10 @@ uci_set firewall client output 'ACCEPT'
uci_set firewall client forward 'REJECT'
uci_commit firewall
uci_set dhcp '@dnsmasq[0]' boguspriv '0'
uci_set dhcp '@dnsmasq[0]' localise_queries '0'
uci_set dhcp '@dnsmasq[0]' rebind_protection '0'
uci_remove dhcp client
uci_add dhcp dhcp client
uci_set dhcp client interface 'client'

View File

@ -0,0 +1,21 @@
#!/bin/sh
[ "$INTERFACE" = 'client' ] || exit 0
mkdir -p /var/gluon/mesh-batman-adv
for ns in $RDNSS $RA_DNS; do
for domain in @mesh_domains@; do
echo "server=/$domain/$ns"
done
done > /var/gluon/mesh-batman-adv/dnsmasq.conf.$$
if cmp -s /var/gluon/mesh-batman-adv/dnsmasq.conf.$$ /var/gluon/mesh-batman-adv/dnsmasq.conf; then
rm /var/gluon/mesh-batman-adv/dnsmasq.conf.$$
exit 0
fi
lock /var/gluon/mesh-batman-adv/dnsmasq.conf.lock
mv -f /var/gluon/mesh-batman-adv/dnsmasq.conf.$$ /var/gluon/mesh-batman-adv/dnsmasq.conf
/etc/init.d/dnsmasq restart
lock -u /var/gluon/mesh-batman-adv/dnsmasq.conf.lock