Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
520eca9548 | ||
|
|
b0c53fb678 | ||
|
|
b78e53ee23 | ||
|
|
0553dc8d70 | ||
|
|
819111f953 |
+9
-3
@@ -79,6 +79,10 @@ _init_vars() {
|
||||
_validate_config() {
|
||||
_log "config: validating uci syntax" "debug"
|
||||
|
||||
if [ -f "/etc/config/xray-manager" ]; then
|
||||
sed -i 's/^ \+/ /g' /etc/config/xray-manager
|
||||
fi
|
||||
|
||||
local dns_confdir
|
||||
dns_confdir=$(uci -q get dhcp.@dnsmasq[0].confdir)
|
||||
if [ -z "$dns_confdir" ] || ! echo "$dns_confdir" | grep -q "$DNSMASQ_DIR"; then
|
||||
@@ -133,7 +137,7 @@ _nft_init() {
|
||||
|
||||
local mark_hex=$(printf '0x%x' "$TPROXY_MARK")
|
||||
_log "route: configuring table $RT_TABLE, mark $mark_hex" "debug"
|
||||
ip route show table $RT_TABLE | grep -q "local default" || ip route add local default dev lo table $RT_TABLE
|
||||
ip route show table $RT_TABLE 2>/dev/null | grep -q "local default" || ip route add local default dev lo table $RT_TABLE
|
||||
ip rule show | grep -q "fwmark $mark_hex lookup $RT_TABLE" || ip rule add fwmark "$TPROXY_MARK" table $RT_TABLE
|
||||
}
|
||||
|
||||
@@ -343,7 +347,6 @@ _run() {
|
||||
DNS_CHANGES=0; NEED_UPDATE=0; : > "$ACTIVE_LIST"
|
||||
|
||||
[ "$FULL_LOAD" = "1" ] && _wait_for_net
|
||||
_wait_for_net
|
||||
_nft_init
|
||||
|
||||
_log "main: processing data sections" "debug"
|
||||
@@ -356,7 +359,10 @@ _run() {
|
||||
config_foreach _process_section "xray-list" "exclude"
|
||||
|
||||
_log "main: applying proxy bypass" "debug"
|
||||
[ -n "$PROXY_SERVERS" ] && nft add rule ip "$TABLE" output ip daddr "@s_proxy_servers" accept 2>/dev/null
|
||||
if [ -n "$PROXY_SERVERS" ]; then
|
||||
_process_item "proxy_servers" "$PROXY_SERVERS" "ip" "out" "0"
|
||||
nft add rule ip "$TABLE" output ip daddr "@s_proxy_servers" accept 2>/dev/null
|
||||
fi
|
||||
|
||||
_log "main: applying tproxy rules" "debug"
|
||||
mode_chain="prerouting"; config_foreach _process_section "xray-list" "main_rules"
|
||||
|
||||
Reference in New Issue
Block a user