From de149441a4044ef3a67d95daab6c21818cf2dc8c Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Fri, 15 Nov 2019 12:48:40 +0100 Subject: [PATCH] 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 --- net/banip/Makefile | 4 ++-- net/banip/files/banip.init | 11 +++++------ net/banip/files/banip.sh | 12 +++++++++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/net/banip/Makefile b/net/banip/Makefile index 43a2c2ef4..26a88014b 100644 --- a/net/banip/Makefile +++ b/net/banip/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=banip -PKG_VERSION:=0.3.9 +PKG_VERSION:=0.3.10 PKG_RELEASE:=1 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken @@ -17,7 +17,7 @@ define Package/banip SECTION:=net CATEGORY:=Network 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 endef diff --git a/net/banip/files/banip.init b/net/banip/files/banip.init index c999c6b00..75fbe5e92 100755 --- a/net/banip/files/banip.init +++ b/net/banip/files/banip.init @@ -4,18 +4,17 @@ START=30 USE_PROCD=1 -EXTRA_COMMANDS="refresh status" -EXTRA_HELP=" refresh Refresh ipsets without new list downloads - status Print runtime information" +EXTRA_COMMANDS="refresh" +EXTRA_HELP=" refresh Refresh ipsets without new list downloads" ban_init="/etc/init.d/banip" ban_script="/usr/bin/banip.sh" ban_pidfile="/var/run/banip.pid" -if [ -s "${ban_pidfile}" ] && \ - [ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ] && [ "${action}" != "enabled" ] +if [ -s "${ban_pidfile}" ] && { [ "${action}" = "start" ] || [ "${action}" = "stop" ] || \ + [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "refresh" ]; } then - exit 1 + exit 0 fi boot() diff --git a/net/banip/files/banip.sh b/net/banip/files/banip.sh index c8639a9c6..0a0f4d0fd 100755 --- a/net/banip/files/banip.sh +++ b/net/banip/files/banip.sh @@ -13,7 +13,7 @@ # LC_ALL=C PATH="/usr/sbin:/usr/bin:/sbin:/bin" -ban_ver="0.3.9" +ban_ver="0.3.10" ban_basever="" ban_enabled=0 ban_automatic="1" @@ -97,6 +97,16 @@ f_envload() config_load banip 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 # if [ -z "${ban_basever}" ] || [ "${ban_ver%.*}" != "${ban_basever}" ]