From a974ddef29619c7fc1533f00ef054c33018d5bc6 Mon Sep 17 00:00:00 2001 From: Akiyamov <116005851+Akiyamov@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:36:40 +0500 Subject: [PATCH 1/3] Add confdir for snapshot --- getdomains-install.sh | 9 +++++++++ tasks/main.yml | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/getdomains-install.sh b/getdomains-install.sh index 044fad4..e8e767d 100755 --- a/getdomains-install.sh +++ b/getdomains-install.sh @@ -326,6 +326,15 @@ dnsmasqfull() { 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 +} remove_forwarding() { if [ ! -z "$forward_id" ]; then while uci -q delete firewall.@forwarding[$forward_id]; do :; done diff --git a/tasks/main.yml b/tasks/main.yml index 18a2b6b..c325f66 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,6 +6,10 @@ shell: opkg list-installed | grep dnsmasq-full | awk '{print $3}' register: dnsmasqfull_version + - name: Check confdir option + shell: uci get dhcp.@dnsmasq[0].confdir + register: dnsmasq_confdir + - name: debug debug: var: ansible_distribution_major_version @@ -63,6 +67,14 @@ when: ansible_distribution_major_version >= "23" and list_domains and not dnsmasqfull_version.stdout ignore_errors: true + - name: set confdir for dnsmasq + uci: + command: set + key: dhcp.@dnsmasq[0] + value: + confdir: "/tmp/dnsmasq.d" + when: dnsmasq_confdir.stdout != "/tmp/dnsmasq.d" + # Getdomains script configure - name: getdomains script copy From ae9e42a5787878900aa88a8fb16f7120ef6f37e1 Mon Sep 17 00:00:00 2001 From: Akiyamov <116005851+Akiyamov@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:16:30 +0500 Subject: [PATCH 2/3] Add func exec --- getdomains-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/getdomains-install.sh b/getdomains-install.sh index e8e767d..e7fe8ea 100755 --- a/getdomains-install.sh +++ b/getdomains-install.sh @@ -995,6 +995,8 @@ add_set dnsmasqfull +dnsmasqconfdir + add_dns_resolver add_getdomains From f3bf5dda1540460b48f36bc86fe92cbc0efa213f Mon Sep 17 00:00:00 2001 From: Akiyamov <116005851+Akiyamov@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:51:37 +0500 Subject: [PATCH 3/3] Update tasks/main.yml Co-authored-by: Morozov Dmitriy --- tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/main.yml b/tasks/main.yml index c325f66..09509ae 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,6 +9,7 @@ - name: Check confdir option shell: uci get dhcp.@dnsmasq[0].confdir register: dnsmasq_confdir + ignore_errors: true - name: debug debug: