banip: update 0.3.10
* add missing logd dependency
* check if logd is enabled during runtime
* some more init tweaks
Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit de149441a4
)
This commit is contained in:
parent
0f67fc96d8
commit
c1575ecf5c
3 changed files with 18 additions and 9 deletions
|
@ -6,7 +6,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=banip
|
PKG_NAME:=banip
|
||||||
PKG_VERSION:=0.3.9
|
PKG_VERSION:=0.3.10
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
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>
|
||||||
|
@ -17,7 +17,7 @@ define Package/banip
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
TITLE:=Ban incoming and/or outgoing ip adresses via ipsets
|
TITLE:=Ban incoming and/or outgoing ip adresses via ipsets
|
||||||
DEPENDS:=+jshn +jsonfilter +ip +ipset +iptables +ca-bundle
|
DEPENDS:=+jshn +jsonfilter +ip +ipset +iptables +ca-bundle +logd
|
||||||
PKGARCH:=all
|
PKGARCH:=all
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
|
@ -4,18 +4,17 @@
|
||||||
START=30
|
START=30
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
|
|
||||||
EXTRA_COMMANDS="refresh status"
|
EXTRA_COMMANDS="refresh"
|
||||||
EXTRA_HELP=" refresh Refresh ipsets without new list downloads
|
EXTRA_HELP=" refresh Refresh ipsets without new list downloads"
|
||||||
status Print runtime information"
|
|
||||||
|
|
||||||
ban_init="/etc/init.d/banip"
|
ban_init="/etc/init.d/banip"
|
||||||
ban_script="/usr/bin/banip.sh"
|
ban_script="/usr/bin/banip.sh"
|
||||||
ban_pidfile="/var/run/banip.pid"
|
ban_pidfile="/var/run/banip.pid"
|
||||||
|
|
||||||
if [ -s "${ban_pidfile}" ] && \
|
if [ -s "${ban_pidfile}" ] && { [ "${action}" = "start" ] || [ "${action}" = "stop" ] || \
|
||||||
[ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ] && [ "${action}" != "enabled" ]
|
[ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "refresh" ]; }
|
||||||
then
|
then
|
||||||
exit 1
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
boot()
|
boot()
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#
|
#
|
||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
ban_ver="0.3.9"
|
ban_ver="0.3.10"
|
||||||
ban_basever=""
|
ban_basever=""
|
||||||
ban_enabled=0
|
ban_enabled=0
|
||||||
ban_automatic="1"
|
ban_automatic="1"
|
||||||
|
@ -97,6 +97,16 @@ f_envload()
|
||||||
config_load banip
|
config_load banip
|
||||||
config_foreach parse_config source
|
config_foreach parse_config source
|
||||||
|
|
||||||
|
# log daemon check
|
||||||
|
#
|
||||||
|
if [ "$(/etc/init.d/log running; printf "%u" "${?}")" -eq 1 ]
|
||||||
|
then
|
||||||
|
unset ban_logger
|
||||||
|
f_log "info" "your log daemon 'logd' is not running, please enable 'logd' to use this service"
|
||||||
|
f_rmtemp
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# version check
|
# version check
|
||||||
#
|
#
|
||||||
if [ -z "${ban_basever}" ] || [ "${ban_ver%.*}" != "${ban_basever}" ]
|
if [ -z "${ban_basever}" ] || [ "${ban_ver%.*}" != "${ban_basever}" ]
|
||||||
|
|
Loading…
Reference in a new issue