default-settings: set dnsmasq logfacility via uci config

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit b0865c8221)
This commit is contained in:
Tianling Shen
2024-05-08 21:51:24 +08:00
parent 55741c4cf2
commit d4d3a20d7c
3 changed files with 18 additions and 18 deletions

View File

@@ -1,19 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021 Lean <coolsnowwolf@gmail.com>
#
# Copyright (C) 2021 ImmortalWrt
# <https://immortalwrt.org>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Copyright (C) 2021-2024 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=default-settings
PKG_RELEASE:=27
PKG_RELEASE:=28
PKG_LICENSE:=GPL-3.0
PKG_LICENSE:=GPL-2.0-only
include $(INCLUDE_DIR)/package.mk

View File

@@ -12,13 +12,16 @@ if ! uci -q get system.@imm_init[0].lang > "/dev/null"; then
EOF
fi
if ! uci -q get system.@imm_init[0].dhcp > "/dev/null"; then
uci -q batch <<-EOF
set dhcp.@dnsmasq[0].logfacility="/dev/null"
commit dhcp
set system.@imm_init[0].dhcp="1"
commit system
EOF
fi
ln -sf "/sbin/ip" "/usr/bin/ip"
sed -i "/log-facility/d" "/etc/dnsmasq.conf"
echo "log-facility=/dev/null" >> "/etc/dnsmasq.conf"
rm -f "/www/luci-static/resources/view/status/include/29_ethinfo.js"
rm -f "/tmp/luci-indexcache"
rm -rf "/tmp/luci-modulecache"
exit 0

View File

@@ -9,8 +9,10 @@ config dnsmasq
option local '/lan/'
option domain 'lan'
option expandhosts 1
option nonegcache 0
option min_cache_ttl 3600
option use_stale_cache 3600
option cachesize 8000
option nonegcache 1
option authoritative 1
option readethers 1
option leasefile '/tmp/dhcp.leases'
@@ -21,11 +23,11 @@ config dnsmasq
#list notinterface lo
#list bogusnxdomain '64.94.110.11'
option localservice 1 # disable to allow DNS requests from non-local subnets
option min_cache_ttl 3600
option dns_redirect 1
option ednspacket_max 1232
option filter_aaaa 0
option filter_a 0
option logfacility /dev/null
#list addnmount /some/path # read-only mount path to expose it to dnsmasq
config dhcp lan