fix: 🐛 自定义链未被主链调用
This commit is contained in:
parent
31c586b004
commit
5e7ef5c89a
|
@ -73,10 +73,10 @@ debug_echo_pass() {
|
||||||
|
|
||||||
# 打印自定义链规则
|
# 打印自定义链规则
|
||||||
print_chain_rules() {
|
print_chain_rules() {
|
||||||
echo_info "当前IPv4自定义链规则:"
|
echo_info "当前IPv4规则:"
|
||||||
iptables -nL $custom_chain_ipv4
|
iptables -L --line-numbers
|
||||||
echo_info "当前IPv6自定义链规则:"
|
echo_info "当前IPv6规则:"
|
||||||
ip6tables -nL $custom_chain_ipv6
|
ip6tables -L --line-numbers
|
||||||
}
|
}
|
||||||
|
|
||||||
print_log() {
|
print_log() {
|
||||||
|
@ -171,13 +171,11 @@ create_chains_and_get_rules() {
|
||||||
# 确保自定义链在主链中被调用函数
|
# 确保自定义链在主链中被调用函数
|
||||||
ensure_chain_calls() {
|
ensure_chain_calls() {
|
||||||
debug_echo_info "确保自定义链在主链中被调用..."
|
debug_echo_info "确保自定义链在主链中被调用..."
|
||||||
iptables -C $chain -j $custom_chain_ipv4 &
|
iptables -C $chain -j $custom_chain_ipv4 > /dev/null 2>&1 || (
|
||||||
>/dev/null || (
|
|
||||||
debug_echo_info "添加 $custom_chain_ipv4 到 $chain"
|
debug_echo_info "添加 $custom_chain_ipv4 到 $chain"
|
||||||
iptables -A $chain -j $custom_chain_ipv4
|
iptables -A $chain -j $custom_chain_ipv4
|
||||||
)
|
)
|
||||||
ip6tables -C $chain -j $custom_chain_ipv6 &
|
ip6tables -C $chain -j $custom_chain_ipv6 > /dev/null 2>&1 || (
|
||||||
>/dev/null || (
|
|
||||||
debug_echo_info "添加 $custom_chain_ipv6 到 $chain"
|
debug_echo_info "添加 $custom_chain_ipv6 到 $chain"
|
||||||
ip6tables -A $chain -j $custom_chain_ipv6
|
ip6tables -A $chain -j $custom_chain_ipv6
|
||||||
)
|
)
|
||||||
|
|
|
@ -49,10 +49,10 @@ BitComet 2.04"
|
||||||
|
|
||||||
# 打印自定义链规则
|
# 打印自定义链规则
|
||||||
print_chain_rules() {
|
print_chain_rules() {
|
||||||
echo "当前IPv4自定义链规则:"
|
echo_info "当前IPv4规则:"
|
||||||
iptables -nL $custom_chain_ipv4
|
iptables -L --line-numbers
|
||||||
echo "当前IPv6自定义链规则:"
|
echo_info "当前IPv6规则:"
|
||||||
ip6tables -nL $custom_chain_ipv6
|
ip6tables -L --line-numbers
|
||||||
}
|
}
|
||||||
|
|
||||||
print_log() {
|
print_log() {
|
||||||
|
@ -151,15 +151,13 @@ create_chains_and_get_rules() {
|
||||||
|
|
||||||
# 确保自定义链在主链中被调用函数
|
# 确保自定义链在主链中被调用函数
|
||||||
ensure_chain_calls() {
|
ensure_chain_calls() {
|
||||||
debug_echo "确保自定义链在主链中被调用..."
|
debug_echo_info "确保自定义链在主链中被调用..."
|
||||||
iptables -C $chain -j $custom_chain_ipv4 &
|
iptables -C $chain -j $custom_chain_ipv4 > /dev/null 2>&1 || (
|
||||||
>/dev/null || (
|
debug_echo_info "添加 $custom_chain_ipv4 到 $chain"
|
||||||
debug_echo "添加 $custom_chain_ipv4 到 $chain"
|
|
||||||
iptables -A $chain -j $custom_chain_ipv4
|
iptables -A $chain -j $custom_chain_ipv4
|
||||||
)
|
)
|
||||||
ip6tables -C $chain -j $custom_chain_ipv6 &
|
ip6tables -C $chain -j $custom_chain_ipv6 > /dev/null 2>&1 || (
|
||||||
>/dev/null || (
|
debug_echo_info "添加 $custom_chain_ipv6 到 $chain"
|
||||||
debug_echo "添加 $custom_chain_ipv6 到 $chain"
|
|
||||||
ip6tables -A $chain -j $custom_chain_ipv6
|
ip6tables -A $chain -j $custom_chain_ipv6
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue