Skip to content

Commit

Permalink
fix: added check if rules exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile committed Jan 13, 2025
1 parent 58817ea commit 780543d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/snort3/files/snort.init
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 780543d

Please sign in to comment.