From c128eff0a541c0cca03eaba10a73730f2290ca2c Mon Sep 17 00:00:00 2001 From: sbwml Date: Mon, 24 Jul 2023 01:11:05 +0800 Subject: [PATCH] luci-app-mosdns: fix IPv6 DNS address format fix #107 --- luci-app-mosdns/Makefile | 2 +- luci-app-mosdns/root/usr/share/mosdns/mosdns.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/luci-app-mosdns/Makefile b/luci-app-mosdns/Makefile index f1d59cc..80de3b7 100644 --- a/luci-app-mosdns/Makefile +++ b/luci-app-mosdns/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-mosdns -PKG_VERSION:=1.5.4 +PKG_VERSION:=1.5.5 PKG_RELEASE:=1 LUCI_TITLE:=LuCI Support for mosdns diff --git a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh index 95f2bc6..2e9f2a7 100755 --- a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh +++ b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh @@ -19,7 +19,12 @@ interface_dns() ( peerdns=$(uci -q get network.wan.peerdns) proto=$(uci -q get network.wan.proto) if [ "$peerdns" = 0 ] || [ "$proto" = "static" ]; then - uci -q get network.wan.dns + ipv6_check=$(uci -q get network.wan.dns) + case "$ipv6_check" in + # ipv6 format + *:*) echo $(uci -q get network.wan.dns) | sed "s/[^ ]*:[^ ]*/'[&]'/g" ;; + *) uci -q get network.wan.dns ;; + esac else interface_status=$(ubus call network.interface.wan status) echo $interface_status | jsonfilter -e "@['dns-server'][0]"