Browse Source

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>
lilik-openwrt-22.03
Dirk Brenken 5 years ago
parent
commit
de149441a4
No known key found for this signature in database GPG Key ID: 9D71CD547BFAE684
3 changed files with 18 additions and 9 deletions
  1. +2
    -2
      net/banip/Makefile
  2. +5
    -6
      net/banip/files/banip.init
  3. +11
    -1
      net/banip/files/banip.sh

+ 2
- 2
net/banip/Makefile View File

@ -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


+ 5
- 6
net/banip/files/banip.init View File

@ -4,18 +4,17 @@
START=30 START=30
USE_PROCD=1 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_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}" ] && \
[ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ] && [ "${action}" != "enabled" ]
if [ -s "${ban_pidfile}" ] && { [ "${action}" = "start" ] || [ "${action}" = "stop" ] || \
[ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "refresh" ]; }
then then
exit 1
exit 0
fi fi
boot() boot()


+ 11
- 1
net/banip/files/banip.sh View File

@ -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…
Cancel
Save