1 Commits

Author SHA1 Message Date
Akiyamov
ae3b6976f7 Merge f3bf5dda15 into 1e7a3bb8f6 2024-12-04 11:51:39 +00:00
2 changed files with 13 additions and 29 deletions

View File

@@ -323,21 +323,18 @@ 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
}
s
dnsmasqconfdir() {
if [ $VERSION_ID -ge 24 ]; then
if uci get dhcp.@dnsmasq[0].confdir | grep -q /tmp/dnsmasq.d; then
printf "\033[32;1mconfdir already 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
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
@@ -972,8 +969,8 @@ printf "\033[34;1mVersion: $OPENWRT_RELEASE\033[0m\n"
VERSION_ID=$(echo $VERSION | awk -F. '{print $1}')
if [ "$VERSION_ID" -ne 23 ] && [ "$VERSION_ID" -ne 24 ]; then
printf "\033[31;1mScript only support OpenWrt 23.05 and 24.10\033[0m\n"
if [ "$VERSION_ID" -ne 23 ]; then
printf "\033[31;1mScript only support OpenWrt 23.05\033[0m\n"
echo "For OpenWrt 21.02 and 22.03 you can:"
echo "1) Use ansible https://github.com/itdoginfo/domain-routing-openwrt"
echo "2) Configure manually. Old manual: https://itdog.info/tochechnaya-marshrutizaciya-na-routere-s-openwrt-wireguard-i-dnscrypt/"

View File

@@ -11,10 +11,6 @@
register: dnsmasq_confdir
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
debug:
var: ansible_distribution_major_version
@@ -78,9 +74,7 @@
key: dhcp.@dnsmasq[0]
value:
confdir: "/tmp/dnsmasq.d"
when: ansible_distribution_major_version >= 24
notify:
- Restart dnsmasq
when: dnsmasq_confdir.stdout != "/tmp/dnsmasq.d"
# Getdomains script configure
@@ -674,13 +668,6 @@
notify:
- Restart firewall
- name: uci commit dhcp
uci:
command: commit
config: dhcp
notify:
- Restart dnsmasq
- name: uci commit network
uci:
command: commit