mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-30 05:50:53 +03:00
remove changeable files from ipset
This commit is contained in:
parent
cf1d6f537b
commit
22a772e96b
@ -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 :
|
Создать ссылку на service unit в systemd :
|
||||||
ln -fs /opt/zapret/init.d/systemd/zapret.service /lib/systemd/system
|
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/clear_lists.sh
|
||||||
По желанию прописать в /opt/zapret/ipset/zapret-hosts-user.txt свои домены.
|
По желанию прописать в /opt/zapret/ipset/zapret-hosts-user.txt свои домены.
|
||||||
|
@ -376,6 +376,13 @@ select_mode_iface()
|
|||||||
esac
|
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()
|
copy_all()
|
||||||
{
|
{
|
||||||
local dir
|
local dir
|
||||||
@ -385,11 +392,13 @@ copy_all()
|
|||||||
for dir in openwrt sysv macos; do
|
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"
|
[ -f "$2/init.d/$dir/custom" ] || cp "$2/init.d/$dir/custom.default" "$2/init.d/$dir/custom"
|
||||||
done
|
done
|
||||||
|
ipset_default_files "$2"
|
||||||
}
|
}
|
||||||
copy_openwrt()
|
copy_openwrt()
|
||||||
{
|
{
|
||||||
local ARCH="$(get_bin_arch)"
|
local ARCH="$(get_bin_arch)"
|
||||||
local BINDIR="$1/binaries/$ARCH"
|
local BINDIR="$1/binaries/$ARCH"
|
||||||
|
local file
|
||||||
|
|
||||||
[ -d "$2" ] || mkdir -p "$2"
|
[ -d "$2" ] || mkdir -p "$2"
|
||||||
|
|
||||||
@ -398,6 +407,7 @@ copy_openwrt()
|
|||||||
cp -R "$1/common" "$1/ipset" "$2"
|
cp -R "$1/common" "$1/ipset" "$2"
|
||||||
cp -R "$1/init.d/openwrt" "$2/init.d"
|
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"
|
[ -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/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"
|
cp "$BINDIR/tpws" "$BINDIR/nfqws" "$BINDIR/ip2net" "$BINDIR/mdig" "$2/binaries/$ARCH"
|
||||||
}
|
}
|
||||||
|
@ -1 +0,0 @@
|
|||||||
pornhub.com
|
|
@ -1 +0,0 @@
|
|||||||
kinozal.tv
|
|
Loading…
Reference in New Issue
Block a user