From 85219cfc38ea36357b5a1c9f91f380e3a5ae8126 Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 23 Jan 2024 13:27:42 +0300 Subject: [PATCH] install_prereq: fix macos --- common/installer.sh | 28 ++++++++++++++++++++++++++++ install_easy.sh | 25 ------------------------- install_prereq.sh | 38 +++++--------------------------------- 3 files changed, 33 insertions(+), 58 deletions(-) diff --git a/common/installer.sh b/common/installer.sh index aefe4ac..6a4a7f6 100644 --- a/common/installer.sh +++ b/common/installer.sh @@ -654,3 +654,31 @@ check_prerequisites_openwrt() fi } } + + + +select_ipv6() +{ + local T=N + + [ "$DISABLE_IPV6" != '1' ] && T=Y + local old6=$DISABLE_IPV6 + echo + if ask_yes_no $T "enable ipv6 support"; then + DISABLE_IPV6=0 + else + DISABLE_IPV6=1 + fi + [ "$old6" != "$DISABLE_IPV6" ] && write_config_var DISABLE_IPV6 +} +select_fwtype() +{ + echo + [ $(get_ram_mb) -le 400 ] && { + echo WARNING ! you are running a low RAM system + echo WARNING ! nft requires lots of RAM to load huge ip sets, much more than ipsets require + echo WARNING ! if you need large lists it may be necessary to fall back to iptables+ipset firewall + } + echo select firewall type : + ask_list FWTYPE "iptables nftables" "$FWTYPE" && write_config_var FWTYPE +} \ No newline at end of file diff --git a/install_easy.sh b/install_easy.sh index 247977b..183ed5c 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -209,31 +209,6 @@ select_getlist() GETLIST="" write_config_var GETLIST } -select_ipv6() -{ - local T=N - - [ "$DISABLE_IPV6" != '1' ] && T=Y - local old6=$DISABLE_IPV6 - echo - if ask_yes_no $T "enable ipv6 support"; then - DISABLE_IPV6=0 - else - DISABLE_IPV6=1 - fi - [ "$old6" != "$DISABLE_IPV6" ] && write_config_var DISABLE_IPV6 -} -select_fwtype() -{ - echo - [ $(get_ram_mb) -le 400 ] && { - echo WARNING ! you are running a low RAM system - echo WARNING ! nft requires lots of RAM to load huge ip sets, much more than ipsets require - echo WARNING ! if you need large lists it may be necessary to fall back to iptables+ipset firewall - } - echo select firewall type : - ask_list FWTYPE "iptables nftables" "$FWTYPE" && write_config_var FWTYPE -} ask_config() { diff --git a/install_prereq.sh b/install_prereq.sh index a4ae4d5..58e1d83 100755 --- a/install_prereq.sh +++ b/install_prereq.sh @@ -15,38 +15,6 @@ ZAPRET_BASE="$EXEDIR" . "$ZAPRET_BASE/common/installer.sh" . "$ZAPRET_BASE/common/ipt.sh" -select_ipv6() -{ - local T=N - - [ "$DISABLE_IPV6" != '1' ] && T=Y - local old6=$DISABLE_IPV6 - echo - if ask_yes_no $T "enable ipv6 support"; then - DISABLE_IPV6=0 - else - DISABLE_IPV6=1 - fi - [ "$old6" != "$DISABLE_IPV6" ] && write_config_var DISABLE_IPV6 -} -select_fwtype() -{ - echo - [ $(get_ram_mb) -le 400 ] && { - echo WARNING ! you are running a low RAM system - echo WARNING ! nft requires lots of RAM to load huge ip sets, much more than ipsets require - echo WARNING ! if you need large lists it may be necessary to fall back to iptables+ipset firewall - } - echo select firewall type : - ask_list FWTYPE "iptables nftables" "$FWTYPE" && write_config_var FWTYPE -} - -ask_config() -{ - [ "$SYSTEM" = openwrt ] && select_ipv6 - select_fwtype -} - # build binaries, do not use precompiled [ "$1" = "make" ] && FORCE_BUILD=1 @@ -55,13 +23,17 @@ umask 0022 fsleep_setup fix_sbin_path check_system +[ $UNAME = "Linux" ] || { + echo no prerequisites required for $SYSTEM +} require_root -ask_config case $UNAME in Linux) + select_fwtype case $SYSTEM in openwrt) + select_ipv6 check_prerequisites_openwrt ;; *)