From 22a772e96b1f21f4ba5f909f5814f1a66378c2d0 Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 30 Jul 2024 17:25:15 +0300 Subject: [PATCH] remove changeable files from ipset --- docs/manual_setup.txt | 10 ++++++++++ install_easy.sh | 10 ++++++++++ ...clude.txt => zapret-hosts-user-exclude.txt.default} | 0 ipset/zapret-hosts-user-ipban.txt | 1 - ipset/zapret-hosts-user.txt | 1 - 5 files changed, 20 insertions(+), 2 deletions(-) rename ipset/{zapret-hosts-user-exclude.txt => zapret-hosts-user-exclude.txt.default} (100%) delete mode 100644 ipset/zapret-hosts-user-ipban.txt delete mode 100644 ipset/zapret-hosts-user.txt diff --git a/docs/manual_setup.txt b/docs/manual_setup.txt index fe45c1c..5dbdcc0 100644 --- a/docs/manual_setup.txt +++ b/docs/manual_setup.txt @@ -26,6 +26,11 @@ Настроить параметры согласно разделу "Выбор параметров". +Создать user листы по умолчанию : + cp /opt/zapret/ipset/zapret-hosts-user-exclude.txt.default /opt/zapret/ipset/zapret-hosts-user-exclude.txt + echo nonexistent.domain >/opt/zapret/ipset/zapret-hosts-user.txt + touch /opt/zapret/ipset/zapret-hosts-user-ipban.txt + Создать ссылку на service unit в systemd : ln -fs /opt/zapret/init.d/systemd/zapret.service /lib/systemd/system @@ -217,6 +222,11 @@ curl можно выкинуть, если для получения ip лист Настроить параметры согласно разделу "Выбор параметров". +Создать user листы по умолчанию : + cp /opt/zapret/ipset/zapret-hosts-user-exclude.txt.default /opt/zapret/ipset/zapret-hosts-user-exclude.txt + echo nonexistent.domain >/opt/zapret/ipset/zapret-hosts-user.txt + touch /opt/zapret/ipset/zapret-hosts-user-ipban.txt + Удалить старые листы, если они были созданы ранее : /opt/zapret/ipset/clear_lists.sh По желанию прописать в /opt/zapret/ipset/zapret-hosts-user.txt свои домены. diff --git a/install_easy.sh b/install_easy.sh index 0c2d852..b2fa5a1 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -376,6 +376,13 @@ select_mode_iface() esac } +ipset_default_files() +{ + [ -f "$1/ipset/$file/zapret-hosts-user-exclude.txt" ] || cp "$1/ipset/$file/zapret-hosts-user-exclude.txt.default" "$1/ipset/$file/zapret-hosts-user-exclude.txt" + [ -f "$1/ipset/$file/zapret-hosts-user.txt" ] || echo nonexistent.domain >> "$1/ipset/$file/zapret-hosts-user.txt" + [ -f "$1/ipset/$file/zapret-hosts-user-ipban.txt" ] || touch "$1/ipset/$file/zapret-hosts-user-ipban.txt" +} + copy_all() { local dir @@ -385,11 +392,13 @@ copy_all() for dir in openwrt sysv macos; do [ -f "$2/init.d/$dir/custom" ] || cp "$2/init.d/$dir/custom.default" "$2/init.d/$dir/custom" done + ipset_default_files "$2" } copy_openwrt() { local ARCH="$(get_bin_arch)" local BINDIR="$1/binaries/$ARCH" + local file [ -d "$2" ] || mkdir -p "$2" @@ -398,6 +407,7 @@ copy_openwrt() cp -R "$1/common" "$1/ipset" "$2" cp -R "$1/init.d/openwrt" "$2/init.d" [ -f "$2/init.d/openwrt/custom" ] || cp "$2/init.d/openwrt/custom.default" "$2/init.d/openwrt/custom" + ipset_default_files "$2" cp "$1/config" "$1/config.default" "$1/install_easy.sh" "$1/uninstall_easy.sh" "$1/install_bin.sh" "$1/install_prereq.sh" "$1/blockcheck.sh" "$2" cp "$BINDIR/tpws" "$BINDIR/nfqws" "$BINDIR/ip2net" "$BINDIR/mdig" "$2/binaries/$ARCH" } diff --git a/ipset/zapret-hosts-user-exclude.txt b/ipset/zapret-hosts-user-exclude.txt.default similarity index 100% rename from ipset/zapret-hosts-user-exclude.txt rename to ipset/zapret-hosts-user-exclude.txt.default diff --git a/ipset/zapret-hosts-user-ipban.txt b/ipset/zapret-hosts-user-ipban.txt deleted file mode 100644 index 6073d92..0000000 --- a/ipset/zapret-hosts-user-ipban.txt +++ /dev/null @@ -1 +0,0 @@ -pornhub.com diff --git a/ipset/zapret-hosts-user.txt b/ipset/zapret-hosts-user.txt deleted file mode 100644 index 923ef61..0000000 --- a/ipset/zapret-hosts-user.txt +++ /dev/null @@ -1 +0,0 @@ -kinozal.tv