From 780543d71a18de739ac4277110817df131a0f74b Mon Sep 17 00:00:00 2001 From: Tommaso Bailetti Date: Mon, 13 Jan 2025 10:13:18 +0100 Subject: [PATCH] fix: added check if rules exists --- packages/snort3/files/snort.init | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/snort3/files/snort.init b/packages/snort3/files/snort.init index 967c4222..a03f5390 100644 --- a/packages/snort3/files/snort.init +++ b/packages/snort3/files/snort.init @@ -33,6 +33,14 @@ update_bypass_set() { } download_rules () { + oinkcode="$(uci -q get snort.snort.oinkcode)" + if [ -z "$oinkcode" ]; then + rules="$(find /var/ns-snort -type f -name "snortrules-*.tar.gz")" + [ -n "$rules" ] && return + else + rules="$(find /var/ns-snort/ -type f -name "*community-rules.tar.gz")" + [ -n "$rules" ] && return + fi # this is done every time the service is started attempt=0 until /usr/bin/ns-snort-rules --download; do