banip: update 0.9.5-2
* fixed possible Set search race condition (initiated from LuCI frontend) * fixed the "no result" Set search problem in LuCI * removed abandoned feeds: spamhaus edrop (was merged with spamhaus drop) Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
parent
2750b16b47
commit
ad755e0c4d
|
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=banip
|
PKG_NAME:=banip
|
||||||
PKG_VERSION:=0.9.5
|
PKG_VERSION:=0.9.5
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
PKG_LICENSE:=GPL-3.0-or-later
|
PKG_LICENSE:=GPL-3.0-or-later
|
||||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||||
|
|
||||||
|
|
|
@ -1559,14 +1559,14 @@ f_search() {
|
||||||
printf "%s\n%s\n%s\n" ":::" "::: no valid search input" ":::"
|
printf "%s\n%s\n%s\n" ":::" "::: no valid search input" ":::"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
printf "%s\n%s\n%s\n" ":::" "::: banIP Search" ":::"
|
|
||||||
printf " %s\n" "Looking for IP '${ip}' on $(date "+%Y-%m-%d %H:%M:%S")"
|
|
||||||
printf " %s\n" "---"
|
|
||||||
cnt="1"
|
cnt="1"
|
||||||
for item in ${table_sets}; do
|
for item in ${table_sets}; do
|
||||||
[ -f "${result_flag}" ] && break
|
[ -f "${result_flag}" ] && break
|
||||||
(
|
(
|
||||||
if "${ban_nftcmd}" get element inet banIP "${item}" "{ ${ip} }" >/dev/null 2>&1; then
|
if "${ban_nftcmd}" get element inet banIP "${item}" "{ ${ip} }" >/dev/null 2>&1; then
|
||||||
|
printf "%s\n%s\n%s\n" ":::" "::: banIP Search" ":::"
|
||||||
|
printf " %s\n" "Looking for IP '${ip}' on $(date "+%Y-%m-%d %H:%M:%S")"
|
||||||
|
printf " %s\n" "---"
|
||||||
printf " %s\n" "IP found in Set '${item}'"
|
printf " %s\n" "IP found in Set '${item}'"
|
||||||
: >"${result_flag}"
|
: >"${result_flag}"
|
||||||
fi
|
fi
|
||||||
|
@ -1576,7 +1576,14 @@ f_search() {
|
||||||
cnt="$((cnt + 1))"
|
cnt="$((cnt + 1))"
|
||||||
done
|
done
|
||||||
wait
|
wait
|
||||||
[ -f "${result_flag}" ] && rm -f "${result_flag}" || printf " %s\n" "IP not found"
|
if [ -f "${result_flag}" ]; then
|
||||||
|
rm -f "${result_flag}"
|
||||||
|
else
|
||||||
|
printf "%s\n%s\n%s\n" ":::" "::: banIP Search" ":::"
|
||||||
|
printf " %s\n" "Looking for IP '${ip}' on $(date "+%Y-%m-%d %H:%M:%S")"
|
||||||
|
printf " %s\n" "---"
|
||||||
|
printf " %s\n" "IP not found"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set survey
|
# Set survey
|
||||||
|
|
|
@ -108,11 +108,6 @@
|
||||||
"rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)[[:space:]]/{printf \"%s/%s,\\n\",$1,$3}",
|
"rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)[[:space:]]/{printf \"%s/%s,\\n\",$1,$3}",
|
||||||
"descr": "dshield IP blocklist"
|
"descr": "dshield IP blocklist"
|
||||||
},
|
},
|
||||||
"edrop":{
|
|
||||||
"url_4": "https://www.spamhaus.org/drop/edrop.txt",
|
|
||||||
"rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)[[:space:]]/{printf \"%s,\\n\",$1}",
|
|
||||||
"descr": "spamhaus edrop compilation"
|
|
||||||
},
|
|
||||||
"etcompromised":{
|
"etcompromised":{
|
||||||
"url_4": "https://iplists.firehol.org/files/et_compromised.ipset",
|
"url_4": "https://iplists.firehol.org/files/et_compromised.ipset",
|
||||||
"rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)$/{printf \"%s,\\n\",$1}",
|
"rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)$/{printf \"%s,\\n\",$1}",
|
||||||
|
|
|
@ -23,10 +23,10 @@ ban_lock="/var/run/banip.lock"
|
||||||
[ "${action}" = "boot" ] && "${ban_init}" running && exit 0
|
[ "${action}" = "boot" ] && "${ban_init}" running && exit 0
|
||||||
{ [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ]; } && ! "${ban_init}" running && exit 0
|
{ [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ]; } && ! "${ban_init}" running && exit 0
|
||||||
[ ! -r "${ban_funlib}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ] || [ "${action}" = "status" ]; } && exit 1
|
[ ! -r "${ban_funlib}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ] || [ "${action}" = "status" ]; } && exit 1
|
||||||
[ -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ]; } && exit 1
|
[ -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; } && exit 1
|
||||||
[ ! -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ]; } && mkdir -p "${ban_lock}"
|
[ ! -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; } && mkdir -p "${ban_lock}"
|
||||||
{ [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ] || [ "${action}" = "status" ]; } && . "${ban_funlib}"
|
{ [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ] || [ "${action}" = "status" ]; } && . "${ban_funlib}"
|
||||||
[ ! -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ]; } && exit 1
|
[ ! -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; } && exit 1
|
||||||
|
|
||||||
boot() {
|
boot() {
|
||||||
: >"${ban_pidfile}"
|
: >"${ban_pidfile}"
|
||||||
|
@ -81,6 +81,7 @@ report() {
|
||||||
|
|
||||||
search() {
|
search() {
|
||||||
f_search "${1}"
|
f_search "${1}"
|
||||||
|
rm -rf "${ban_lock}"
|
||||||
}
|
}
|
||||||
|
|
||||||
survey() {
|
survey() {
|
||||||
|
|
Loading…
Reference in New Issue