mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2025-12-11 17:44:29 +05:00
Add confdir for snapshot
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user