mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2025-12-13 10:34:29 +05:00
Compare commits
3 Commits
ae3b6976f7
...
86d26c1d25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86d26c1d25 | ||
|
|
86b9c1c075 | ||
|
|
7b1f1631b3 |
@@ -323,18 +323,22 @@ dnsmasqfull() {
|
|||||||
opkg remove dnsmasq && opkg install dnsmasq-full --cache /tmp/
|
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
|
[ -f /etc/config/dhcp-opkg ] && cp /etc/config/dhcp /etc/config/dhcp-old && mv /etc/config/dhcp-opkg /etc/config/dhcp
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
dnsmasqconfdir() {
|
dnsmasqconfdir() {
|
||||||
if uci get dhcp.@dnsmasq[0].confdir | grep -q /tmp/dnsmasq.d; then
|
openwrt_release=$(cat /etc/openwrt_release | grep -Eo [0-9]{2}[.][0-9]{2}[.][0-9]* | cut -d '.' -f 1 | tail -n 1)
|
||||||
printf "\033[32;1mconfdir alreadt set\033[0m\n"
|
if [ $openwrt_release -ge 24 ]; then
|
||||||
else
|
if uci get dhcp.@dnsmasq[0].confdir | grep -q /tmp/dnsmasq.d; then
|
||||||
printf "\033[32;1mSetting confdir\033[0m\n"
|
printf "\033[32;1mconfdir alreadt set\033[0m\n"
|
||||||
uci set dhcp.@dnsmasq[0].confdir='/tmp/dnsmasq.d'
|
else
|
||||||
uci commit dhcp
|
printf "\033[32;1mSetting confdir\033[0m\n"
|
||||||
fi
|
uci set dhcp.@dnsmasq[0].confdir='/tmp/dnsmasq.d'
|
||||||
|
uci commit dhcp
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_forwarding() {
|
remove_forwarding() {
|
||||||
if [ ! -z "$forward_id" ]; then
|
if [ ! -z "$forward_id" ]; then
|
||||||
while uci -q delete firewall.@forwarding[$forward_id]; do :; done
|
while uci -q delete firewall.@forwarding[$forward_id]; do :; done
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
register: dnsmasq_confdir
|
register: dnsmasq_confdir
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Get openwrt major release
|
||||||
|
shell: cat /etc/openwrt_release | grep -Eo [0-9]{2}[.][0-9]{2}[.][0-9]* | cut -d '.' -f 1 | tail -n 1
|
||||||
|
register: openwrt_major_release
|
||||||
|
|
||||||
- name: debug
|
- name: debug
|
||||||
debug:
|
debug:
|
||||||
var: ansible_distribution_major_version
|
var: ansible_distribution_major_version
|
||||||
@@ -74,7 +78,7 @@
|
|||||||
key: dhcp.@dnsmasq[0]
|
key: dhcp.@dnsmasq[0]
|
||||||
value:
|
value:
|
||||||
confdir: "/tmp/dnsmasq.d"
|
confdir: "/tmp/dnsmasq.d"
|
||||||
when: dnsmasq_confdir.stdout != "/tmp/dnsmasq.d"
|
when: dnsmasq_confdir.stdout != "/tmp/dnsmasq.d" and openwrt_major_release >= 24
|
||||||
|
|
||||||
# Getdomains script configure
|
# Getdomains script configure
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user