From 467804eb74b5d7b7e57f8ed4ec4ae830317a6f46 Mon Sep 17 00:00:00 2001 From: Vadim Vetrov Date: Sat, 7 Sep 2024 14:15:46 +0300 Subject: [PATCH] Update entware script Related to #97 --- youtubeUnblock/files/S51youtubeUnblock | 47 +++----------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/youtubeUnblock/files/S51youtubeUnblock b/youtubeUnblock/files/S51youtubeUnblock index cd5b237..64720dd 100755 --- a/youtubeUnblock/files/S51youtubeUnblock +++ b/youtubeUnblock/files/S51youtubeUnblock @@ -118,55 +118,16 @@ firewall_stop_v6() { _iptables ip6tables -D OUTPUT -t filter -m mark --mark 32768/32768 -j ACCEPT } -check_ipt_connbytes() { - iptables -C FORWARD -m connbytes --connbytes-dir original --connbytes-mode packets --connbytes 0:19 -j ACCEPT &>/dev/null - - if [ $? -eq 2 ]; then - return 1 - else - return 0 - fi -} - -check_ipt_nfqueue() { - iptables -C FORWARD -t mangle -j NFQUEUE --queue-num 537 &>/dev/null - - if [ $? -eq 2 ]; then - return 1 - else - return 0 - fi -} - kernel_modules_load() { KERNEL=$(uname -r) - if ! check_ipt_connbytes; then - connbytes_mod_path=$(find /lib/modules/$(uname -r) -name "xt_connbytes.ko*") - - if [ -z "$connbytes_mod_path" ]; then - echo -e "$ansi_red Cannot find xt_connbytes.ko module $ansi_std" - else - insmod "$connbytes_mod_path" || exit 1 - echo "xt_connbytes.ko loaded" - fi - fi - - if ! check_ipt_nfqueue; then - nfqueue_mod_path=$(find /lib/modules/$(uname -r) -name "xt_NFQUEUE.ko*") - - if [ -z "$nfqueue_mod_path" ]; then - echo -e "$ansi_red Cannot find xt_NFQUEUE.ko module $ansi_std" - else - insmod "$nfqueue_mod_path" || exit 1 - echo "xt_NFQUEUE.ko loaded" - fi - fi + (modprobe xt_connbytes --first-time &>/dev/null && echo "xt_connbytes loaded") || true + (modprobe xt_NFQUEUE --first-time &>/dev/null && echo "xt_NFQUEUE loaded") || true } system_config() { - sysctl -w net.netfilter.nf_conntrack_checksum=0 &> /dev/null || exit 1 - sysctl -w net.netfilter.nf_conntrack_tcp_be_liberal=1 &> /dev/null || exit 1 + sysctl -w net.netfilter.nf_conntrack_checksum=0 &> /dev/null || true + sysctl -w net.netfilter.nf_conntrack_tcp_be_liberal=1 &> /dev/null || true } status() {