mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-02 06:30:53 +03:00
Compare commits
No commits in common. "6ac84b85fb1ac52650f7110a7832e89710f4f3d5" and "0117374d89a3291c5b43d7c737f1a3c6356e022d" have entirely different histories.
6ac84b85fb
...
0117374d89
@ -2,13 +2,9 @@
|
||||
|
||||
EXEDIR="$(dirname "$0")"
|
||||
EXEDIR="$(cd "$EXEDIR"; pwd)"
|
||||
ZAPRET_CONFIG="$EXEDIR/config"
|
||||
ZAPRET_BASE="$EXEDIR"
|
||||
|
||||
[ -f "$ZAPRET_CONFIG" ] || {
|
||||
[ -f "${ZAPRET_CONFIG}.default" ] && cp "${ZAPRET_CONFIG}.default" "$ZAPRET_CONFIG"
|
||||
}
|
||||
[ -f "$ZAPRET_CONFIG" ] && . "$ZAPRET_CONFIG"
|
||||
[ -f "$ZAPRET_BASE/config" ] && . "$ZAPRET_BASE/config"
|
||||
. "$ZAPRET_BASE/common/base.sh"
|
||||
. "$ZAPRET_BASE/common/dialog.sh"
|
||||
. "$ZAPRET_BASE/common/elevate.sh"
|
||||
|
@ -21,16 +21,8 @@
|
||||
АЛЬТЕРНАТИВА : make -C /opt/zapret. Получите динамические бинарики под вашу ось.
|
||||
Для сборки требуются dev пакеты : zlib1g-dev libcap-dev libnetfilter-queue-dev
|
||||
|
||||
Создать конфиг по умолчанию :
|
||||
cp /opt/zapret/config.default /opt/zapret/config
|
||||
|
||||
Настроить параметры согласно разделу "Выбор параметров".
|
||||
|
||||
Создать 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,16 +209,8 @@ curl можно выкинуть, если для получения ip лист
|
||||
Создать ссылку на скрипт события поднятия интерфейса :
|
||||
ln -fs /opt/zapret/init.d/openwrt/90-zapret /etc/hotplug.d/iface
|
||||
|
||||
Создать конфиг по умолчанию :
|
||||
cp /opt/zapret/config.default /opt/zapret/config
|
||||
|
||||
Настроить параметры согласно разделу "Выбор параметров".
|
||||
|
||||
Создать 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 свои домены.
|
||||
|
@ -8,7 +8,6 @@ IPSET_DIR="$EXEDIR/ipset"
|
||||
ZAPRET_CONFIG="$EXEDIR/config"
|
||||
ZAPRET_BASE="$EXEDIR"
|
||||
|
||||
[ -f "$ZAPRET_CONFIG" ] || cp "${ZAPRET_CONFIG}.default" "$ZAPRET_CONFIG"
|
||||
. "$ZAPRET_CONFIG"
|
||||
. "$ZAPRET_BASE/common/base.sh"
|
||||
. "$ZAPRET_BASE/common/elevate.sh"
|
||||
@ -376,29 +375,15 @@ 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
|
||||
|
||||
cp -R "$1" "$2"
|
||||
[ -d "$2/tmp" ] || mkdir "$2/tmp"
|
||||
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"
|
||||
|
||||
@ -406,9 +391,7 @@ copy_openwrt()
|
||||
cp -R "$1/files/fake" "$2/files"
|
||||
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 "$1/config" "$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"
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ EXEDIR="$(cd "$EXEDIR"; pwd)"
|
||||
ZAPRET_CONFIG="$EXEDIR/config"
|
||||
ZAPRET_BASE="$EXEDIR"
|
||||
|
||||
[ -f "$ZAPRET_CONFIG" ] || cp "${ZAPRET_CONFIG}.default" "$ZAPRET_CONFIG"
|
||||
. "$ZAPRET_CONFIG"
|
||||
. "$ZAPRET_BASE/common/base.sh"
|
||||
. "$ZAPRET_BASE/common/elevate.sh"
|
||||
. "$ZAPRET_BASE/common/fwtype.sh"
|
||||
|
1
ipset/zapret-hosts-user-ipban.txt
Normal file
1
ipset/zapret-hosts-user-ipban.txt
Normal file
@ -0,0 +1 @@
|
||||
pornhub.com
|
1
ipset/zapret-hosts-user.txt
Normal file
1
ipset/zapret-hosts-user.txt
Normal file
@ -0,0 +1 @@
|
||||
kinozal.tv
|
Loading…
Reference in New Issue
Block a user