diff mbox

[LEDE-DEV,v3] dnsmasq: also write /tmp/resolv.conf when UCI dhcp.dnsmasq.noresolv is '1'

Message ID 20170514115446.44525-1-por@xs4all.nl
State Superseded
Delegated to: Mathias Kresin
Headers show

Commit Message

Paul Oranje May 14, 2017, 11:54 a.m. UTC
fixes FS#785
v3: corrected typo (noreolv)
v2: also change guard in dnsmasq_stop() routine
v1: write /tmp/resolv.conf also when noresolv is true

Signed-off-by: Paul Oranje <por@xs4all.nl>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul Oranje May 14, 2017, 1:13 p.m. UTC | #1
Please ignore, a v4 has been submitted without patch version bla bla in the commit message.
Paul

> Op 14 mei 2017, om 13:54 heeft Paul Oranje <por@xs4all.nl> het volgende geschreven:
> 
> fixes FS#785
> v3: corrected typo (noreolv)
> v2: also change guard in dnsmasq_stop() routine
> v1: write /tmp/resolv.conf also when noresolv is true
> 
> Signed-off-by: Paul Oranje <por@xs4all.nl>
> ---
> package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
> index 30fec7a4ee..197aae9de1 100644
> --- a/package/network/services/dnsmasq/files/dnsmasq.init
> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
> @@ -947,7 +947,7 @@ dnsmasq_start()
> 	echo >> $CONFIGFILE_TMP
> 	mv -f $CONFIGFILE_TMP $CONFIGFILE
> 
> -	[ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> +	[ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> 		rm -f /tmp/resolv.conf
> 		[ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
> 			echo "search $DOMAIN" >> /tmp/resolv.conf
> @@ -982,7 +982,7 @@ dnsmasq_stop()
> 	config_get resolvfile "$cfg" "resolvfile"
> 
> 	#relink /tmp/resolve.conf only for main instance
> -	[ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> +	[ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> 		[ -f /tmp/resolv.conf ] && {
> 			rm -f /tmp/resolv.conf
> 			ln -s "$resolvfile" /tmp/resolv.conf
> -- 
> 2.12.2
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
diff mbox

Patch

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 30fec7a4ee..197aae9de1 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -947,7 +947,7 @@  dnsmasq_start()
 	echo >> $CONFIGFILE_TMP
 	mv -f $CONFIGFILE_TMP $CONFIGFILE
 
-	[ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
+	[ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
 		rm -f /tmp/resolv.conf
 		[ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
 			echo "search $DOMAIN" >> /tmp/resolv.conf
@@ -982,7 +982,7 @@  dnsmasq_stop()
 	config_get resolvfile "$cfg" "resolvfile"
 
 	#relink /tmp/resolve.conf only for main instance
-	[ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
+	[ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
 		[ -f /tmp/resolv.conf ] && {
 			rm -f /tmp/resolv.conf
 			ln -s "$resolvfile" /tmp/resolv.conf