mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-11 17:29:16 +05:00
ipset: always resolve ipban list
This commit is contained in:
parent
a4e36eb067
commit
d8749c7550
18
ipset/def.sh
18
ipset/def.sh
@ -222,6 +222,13 @@ getexclude()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_get_ipban()
|
||||||
|
{
|
||||||
|
[ -f "$ZUSERLIST_IPBAN" ] && {
|
||||||
|
[ "$DISABLE_IPV4" != "1" ] && filedigger "$ZUSERLIST_IPBAN" 4 | cut_local | sort -u > "$ZIPLIST_USER_IPBAN"
|
||||||
|
[ "$DISABLE_IPV6" != "1" ] && filedigger "$ZUSERLIST_IPBAN" 6 | cut_local6 | sort -u > "$ZIPLIST_USER_IPBAN6"
|
||||||
|
}
|
||||||
|
}
|
||||||
getuser()
|
getuser()
|
||||||
{
|
{
|
||||||
getexclude || return
|
getexclude || return
|
||||||
@ -229,10 +236,13 @@ getuser()
|
|||||||
[ "$DISABLE_IPV4" != "1" ] && filedigger "$ZUSERLIST" 4 | cut_local | sort -u > "$ZIPLIST_USER"
|
[ "$DISABLE_IPV4" != "1" ] && filedigger "$ZUSERLIST" 4 | cut_local | sort -u > "$ZIPLIST_USER"
|
||||||
[ "$DISABLE_IPV6" != "1" ] && filedigger "$ZUSERLIST" 6 | cut_local6 | sort -u > "$ZIPLIST_USER6"
|
[ "$DISABLE_IPV6" != "1" ] && filedigger "$ZUSERLIST" 6 | cut_local6 | sort -u > "$ZIPLIST_USER6"
|
||||||
}
|
}
|
||||||
[ -f "$ZUSERLIST_IPBAN" ] && {
|
_get_ipban
|
||||||
[ "$DISABLE_IPV4" != "1" ] && filedigger "$ZUSERLIST_IPBAN" 4 | cut_local | sort -u > "$ZIPLIST_USER_IPBAN"
|
return 0
|
||||||
[ "$DISABLE_IPV6" != "1" ] && filedigger "$ZUSERLIST_IPBAN" 6 | cut_local6 | sort -u > "$ZIPLIST_USER_IPBAN6"
|
}
|
||||||
}
|
getipban()
|
||||||
|
{
|
||||||
|
getexclude || return
|
||||||
|
_get_ipban
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ IPSET_DIR="$(cd "$IPSET_DIR"; pwd)"
|
|||||||
|
|
||||||
# useful in case ipban set is used in custom scripts
|
# useful in case ipban set is used in custom scripts
|
||||||
FAIL=
|
FAIL=
|
||||||
getuser || FAIL=1
|
getipban || FAIL=1
|
||||||
"$IPSET_DIR/create_ipset.sh"
|
"$IPSET_DIR/create_ipset.sh"
|
||||||
[ -n "$FAIL" ] && exit
|
[ -n "$FAIL" ] && exit
|
||||||
|
|
||||||
|
@ -6,5 +6,5 @@ IPSET_DIR="$(cd "$IPSET_DIR"; pwd)"
|
|||||||
|
|
||||||
. "$IPSET_DIR/../config"
|
. "$IPSET_DIR/../config"
|
||||||
|
|
||||||
[ -z "$GETLIST" ] && GETLIST=get_exclude.sh
|
[ -z "$GETLIST" ] && GETLIST=get_ipban.sh
|
||||||
[ -x "$IPSET_DIR/$GETLIST" ] && exec "$IPSET_DIR/$GETLIST"
|
[ -x "$IPSET_DIR/$GETLIST" ] && exec "$IPSET_DIR/$GETLIST"
|
||||||
|
11
ipset/get_ipban.sh
Executable file
11
ipset/get_ipban.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# resolve only ipban user host list
|
||||||
|
|
||||||
|
IPSET_DIR="$(dirname "$0")"
|
||||||
|
IPSET_DIR="$(cd "$IPSET_DIR"; pwd)"
|
||||||
|
|
||||||
|
. "$IPSET_DIR/def.sh"
|
||||||
|
|
||||||
|
getipban
|
||||||
|
|
||||||
|
"$IPSET_DIR/create_ipset.sh"
|
@ -7,7 +7,7 @@ IPSET_DIR="$(cd "$IPSET_DIR"; pwd)"
|
|||||||
|
|
||||||
# useful in case ipban set is used in custom scripts
|
# useful in case ipban set is used in custom scripts
|
||||||
FAIL=
|
FAIL=
|
||||||
getuser || FAIL=1
|
getipban || FAIL=1
|
||||||
"$IPSET_DIR/create_ipset.sh"
|
"$IPSET_DIR/create_ipset.sh"
|
||||||
[ -n "$FAIL" ] && exit
|
[ -n "$FAIL" ] && exit
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user