mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add IP of domains each restart of omr-bypass
This commit is contained in:
parent
8ce2c27338
commit
4207636899
1 changed files with 15 additions and 0 deletions
|
@ -18,6 +18,19 @@ _bypass_ip() {
|
|||
fi
|
||||
}
|
||||
|
||||
_bypass_domain() {
|
||||
# Bypass domain even if OMR DNS is not used
|
||||
domains=$(uci -q get dhcp.@dnsmasq[0].ipset)
|
||||
for domain in ${domains//\// }; do
|
||||
if [ -n "$domain" ] && [ "$domain" != "ss_rules_dst_bypass" ]; then
|
||||
resolve=$(dig a +nocmd +noall +answer $domain | awk '{print $5}')
|
||||
for ip in $resolve; do
|
||||
_bypass_ip $ip
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
_bypass_proto() {
|
||||
local proto="$1"
|
||||
[ -z "$proto" ] && return
|
||||
|
@ -34,6 +47,8 @@ start_service() {
|
|||
config_load omr-bypass
|
||||
config_list_foreach ips "ip" _bypass_ip
|
||||
|
||||
_bypass_domain
|
||||
|
||||
ip rule add prio 1 fwmark 0x539 lookup 991337 > /dev/null 2>&1
|
||||
|
||||
if [ "$(iptables -w 40 -t mangle -L | grep 'match-set ss_rules_dst_bypass dst MARK set')" = "" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue