Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/ns-threat_shield/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ define Package/ns-threat_shield/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/banip-defaults $(1)/etc/uci-defaults/99-nethsec-banip
$(INSTALL_BIN) ./files/banip-extra-defaults $(1)/etc/uci-defaults/96-nethsec-banip-extra
$(INSTALL_BIN) ./files/banip-insights-defaults $(1)/etc/uci-defaults/97-nethsec-banip-insights
$(INSTALL_BIN) ./files/97-nethsec-banip-feeds $(1)/etc/uci-defaults/97-nethsec-banip-feeds
$(INSTALL_BIN) ./files/banip-insights-defaults $(1)/etc/uci-defaults/98-nethsec-banip-insights
$(INSTALL_BIN) ./files/35_ns-threat_shield $(1)/etc/uci-defaults/35_ns-threat_shield
$(INSTALL_BIN) ./files/96_ns-threat_shield $(1)/etc/uci-defaults/96_ns-threat_shield
gzip -9n $(1)/usr/share/threat_shield/nethesis-dns.sources
Expand All @@ -74,8 +75,7 @@ endef
define Package/ns-threat_shield/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
(. /etc/uci-defaults/20_threat_shield)
rm -f /etc/uci-defaults/20_threat_shield
/etc/init.d/banip reload
/etc/init.d/rsyslog restart
/etc/init.d/cron restart
fi
Expand Down
20 changes: 20 additions & 0 deletions packages/ns-threat_shield/files/97-nethsec-banip-feeds
Comment thread
m-dilorenzi marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

#
# Copyright (C) 2026 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-2.0-only
#

# Rebuild the enterprise feeds left in the banIP 1.0 format (rule_4) by an upgrade.
# apk can install banip before ns-threat_shield: 95-banip-housekeeping then runs ts-ip
# with the old banip.nethesis.feeds, and banIP skips the enterprise feeds as incomplete.
# If banip.feeds is still in the old format banip is not updated yet, and its own
# housekeeping rebuilds the file later.
# The postinst reloads banIP after all the uci-defaults.

grep -q '"rule_4"' /etc/banip/banip.custom.feeds 2>/dev/null || exit 0
grep -q '"rule_4"' /etc/banip/banip.feeds && exit 0

/usr/sbin/ts-ip

exit 0
Loading