* fix a corner case backup issue with empty feed downloads
Signed-off-by: Dirk Brenken <dev@brenken.org>
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>
# 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}"