Skip to content

Commit 982a1aa

Browse files
author
Шоколад
committed
fix condition for fake-ip range in box.iptables based on enhanced-mode
1 parent 57f9dbd commit 982a1aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

box/scripts/box.iptables

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ case "${bin_name}" in
2929
"clash")
3030
clash_mode=$(busybox awk '!/^ *#/ && /mode: / { print $2;found=1; exit } END{ if(!found) print "rules" }' "${clash_config}" 2>/dev/null)
3131
clash_enhanced_mode=$(busybox awk '!/^ *#/ && /enhanced-mode: / { print $2;found=1; exit } END{ if(!found) print "fake-ip" }' "${clash_config}" 2>/dev/null)
32-
[ ${clash_enhanced_mode} != "fake-ip" ] && fake_ip_range=$(busybox awk '!/^ *#/ && /fake-ip-range:/ { print $2; found=1; exit } END { if (!found) print "198.18.0.1/16" }' "${clash_config}" 2>/dev/null)
32+
[ ${clash_enhanced_mode} = "fake-ip" ] && fake_ip_range=$(busybox awk '!/^ *#/ && /fake-ip-range:/ { print $2; found=1; exit } END { if (!found) print "198.18.0.1/16" }' "${clash_config}" 2>/dev/null)
3333
clash_dns_port=$(sed -n '/^dns:/,/^[^ ]/p' "${clash_config}" | grep -E '^[^#]*listen:.*:[0-9]+' | grep -Eo '[0-9]+' | tail -n 1)
3434
clash_dns_port=${clash_dns_port:-1053}
3535
if [[ "${network_mode}" == @(mixed|tun) ]]; then

0 commit comments

Comments
 (0)