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