banip: update 0.8.9-2
authorDirk Brenken <dev@brenken.org>
Fri, 7 Jul 2023 18:03:08 +0000 (20:03 +0200)
committerDirk Brenken <dev@brenken.org>
Fri, 7 Jul 2023 18:03:08 +0000 (20:03 +0200)
* fix a corner case backup issue with empty feed downloads

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/banip/Makefile
net/banip/files/banip-functions.sh

index 98004dd1ebbf1d5801da653eb583d044e1ec3c2b..4be2afd6955192ae63d78a2f0cbb07e3970abbb3 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=banip
 PKG_VERSION:=0.8.9
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index 2d64f678a01fc0f125e088ab370d89bff937228b..1fa1578d65cf3045337c054a78c52404e8b1ad62 100644 (file)
@@ -952,10 +952,12 @@ f_down() {
 # backup feeds
 #
 f_backup() {
-       local backup_rc feed="${1}" feed_file="${2}"
+       local backup_rc="4" feed="${1}" feed_file="${2}"
 
-       gzip -cf "${feed_file}" >"${ban_backupdir}/banIP.${feed}.gz"
-       backup_rc="${?}"
+       if [ -s "${feed_file}" ]; then
+               gzip -cf "${feed_file}" >"${ban_backupdir}/banIP.${feed}.gz"
+               backup_rc="${?}"
+       fi
 
        f_log "debug" "f_backup    ::: feed: ${feed}, file: banIP.${feed}.gz, rc: ${backup_rc}"
        return "${backup_rc}"