luci-app-mosdns: fix IPv6 DNS address format

fix #107
This commit is contained in:
sbwml 2023-07-24 01:11:05 +08:00
parent 1905b25fab
commit c128eff0a5
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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]"