From 7b1f1631b3727c19b5a812ba342b086d184a0ca7 Mon Sep 17 00:00:00 2001 From: Akiyamov <116005851+Akiyamov@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:55:03 +0500 Subject: [PATCH] Execute confdir only for 24 and newer versions --- getdomains-install.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/getdomains-install.sh b/getdomains-install.sh index e7fe8ea..130be08 100755 --- a/getdomains-install.sh +++ b/getdomains-install.sh @@ -323,18 +323,22 @@ dnsmasqfull() { opkg remove dnsmasq && opkg install dnsmasq-full --cache /tmp/ [ -f /etc/config/dhcp-opkg ] && cp /etc/config/dhcp /etc/config/dhcp-old && mv /etc/config/dhcp-opkg /etc/config/dhcp -fi + fi } dnsmasqconfdir() { - if uci get dhcp.@dnsmasq[0].confdir | grep -q /tmp/dnsmasq.d; then - printf "\033[32;1mconfdir alreadt set\033[0m\n" - else - printf "\033[32;1mSetting confdir\033[0m\n" - uci set dhcp.@dnsmasq[0].confdir='/tmp/dnsmasq.d' - uci commit dhcp -fi + openwrt_release=$(cat /etc/openwrt_release | grep -Eo [0-9]{2}[.][0-9]{2}[.][0-9]* | cut -d '.' -f 1 | tail -n 1) + if [ $openwrt_release -ge 24 ]; then + if uci get dhcp.@dnsmasq[0].confdir | grep -q /tmp/dnsmasq.d; then + printf "\033[32;1mconfdir alreadt set\033[0m\n" + else + printf "\033[32;1mSetting confdir\033[0m\n" + uci set dhcp.@dnsmasq[0].confdir='/tmp/dnsmasq.d' + uci commit dhcp + fi + fi } + remove_forwarding() { if [ ! -z "$forward_id" ]; then while uci -q delete firewall.@forwarding[$forward_id]; do :; done