mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2025-12-17 12:34:31 +05:00
Compare commits
1 Commits
master
...
86d26c1d25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86d26c1d25 |
@@ -205,7 +205,7 @@ cat << 'EOF' > /etc/sing-box/config.json
|
|||||||
"type": "tun",
|
"type": "tun",
|
||||||
"interface_name": "tun0",
|
"interface_name": "tun0",
|
||||||
"domain_strategy": "ipv4_only",
|
"domain_strategy": "ipv4_only",
|
||||||
"address": ["172.16.250.1/30"],
|
"inet4_address": "172.16.250.1/30",
|
||||||
"auto_route": false,
|
"auto_route": false,
|
||||||
"strict_route": false,
|
"strict_route": false,
|
||||||
"sniff": true
|
"sniff": true
|
||||||
@@ -327,9 +327,10 @@ dnsmasqfull() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dnsmasqconfdir() {
|
dnsmasqconfdir() {
|
||||||
if [ $VERSION_ID -ge 24 ]; then
|
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
|
if uci get dhcp.@dnsmasq[0].confdir | grep -q /tmp/dnsmasq.d; then
|
||||||
printf "\033[32;1mconfdir already set\033[0m\n"
|
printf "\033[32;1mconfdir alreadt set\033[0m\n"
|
||||||
else
|
else
|
||||||
printf "\033[32;1mSetting confdir\033[0m\n"
|
printf "\033[32;1mSetting confdir\033[0m\n"
|
||||||
uci set dhcp.@dnsmasq[0].confdir='/tmp/dnsmasq.d'
|
uci set dhcp.@dnsmasq[0].confdir='/tmp/dnsmasq.d'
|
||||||
@@ -972,8 +973,8 @@ printf "\033[34;1mVersion: $OPENWRT_RELEASE\033[0m\n"
|
|||||||
|
|
||||||
VERSION_ID=$(echo $VERSION | awk -F. '{print $1}')
|
VERSION_ID=$(echo $VERSION | awk -F. '{print $1}')
|
||||||
|
|
||||||
if [ "$VERSION_ID" -ne 23 ] && [ "$VERSION_ID" -ne 24 ]; then
|
if [ "$VERSION_ID" -ne 23 ]; then
|
||||||
printf "\033[31;1mScript only support OpenWrt 23.05 and 24.10\033[0m\n"
|
printf "\033[31;1mScript only support OpenWrt 23.05\033[0m\n"
|
||||||
echo "For OpenWrt 21.02 and 22.03 you can:"
|
echo "For OpenWrt 21.02 and 22.03 you can:"
|
||||||
echo "1) Use ansible https://github.com/itdoginfo/domain-routing-openwrt"
|
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/"
|
echo "2) Configure manually. Old manual: https://itdog.info/tochechnaya-marshrutizaciya-na-routere-s-openwrt-wireguard-i-dnscrypt/"
|
||||||
|
|||||||
@@ -78,9 +78,7 @@
|
|||||||
key: dhcp.@dnsmasq[0]
|
key: dhcp.@dnsmasq[0]
|
||||||
value:
|
value:
|
||||||
confdir: "/tmp/dnsmasq.d"
|
confdir: "/tmp/dnsmasq.d"
|
||||||
when: ansible_distribution_major_version >= 24
|
when: dnsmasq_confdir.stdout != "/tmp/dnsmasq.d" and openwrt_major_release >= 24
|
||||||
notify:
|
|
||||||
- Restart dnsmasq
|
|
||||||
|
|
||||||
# Getdomains script configure
|
# Getdomains script configure
|
||||||
|
|
||||||
@@ -674,13 +672,6 @@
|
|||||||
notify:
|
notify:
|
||||||
- Restart firewall
|
- Restart firewall
|
||||||
|
|
||||||
- name: uci commit dhcp
|
|
||||||
uci:
|
|
||||||
command: commit
|
|
||||||
config: dhcp
|
|
||||||
notify:
|
|
||||||
- Restart dnsmasq
|
|
||||||
|
|
||||||
- name: uci commit network
|
- name: uci commit network
|
||||||
uci:
|
uci:
|
||||||
command: commit
|
command: commit
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"type": "tun",
|
"type": "tun",
|
||||||
"interface_name": "tun0",
|
"interface_name": "tun0",
|
||||||
"domain_strategy": "ipv4_only",
|
"domain_strategy": "ipv4_only",
|
||||||
"address": ["172.16.250.1/30"],
|
"inet4_address": "172.16.250.1/30",
|
||||||
"auto_route": false,
|
"auto_route": false,
|
||||||
"strict_route": false,
|
"strict_route": false,
|
||||||
"sniff": true
|
"sniff": true
|
||||||
|
|||||||
Reference in New Issue
Block a user