Skip to content

Commit

Permalink
Refactor Snort installation script for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bengo237 committed Sep 12, 2024
1 parent f5bc8ba commit 33e7c54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ configure_snort_logging_macos() {
local content_to_add='alert_fast =\n{\n file = true\n}'

info_message "Configuring Snort logging"
if ! grep -q "$content_to_add" "$config_file"; then
if ! maybe_sudo grep -q "$content_to_add" "$config_file"; then
echo -e "$content_to_add" | maybe_sudo tee -a "$config_file" > /dev/null
success_message "Snort logging configured in $config_file"
else
Expand Down Expand Up @@ -235,7 +235,7 @@ configure_snort_linux() {
maybe_sudo tar -xvzf community-rules.tar.gz -C /etc/snort/rules --strip-components=1
maybe_sudo rm community-rules.tar.gz

if ! grep -q "include \$RULE_PATH/community.rules" /etc/snort/snort.conf; then
if ! maybe_sudo grep -q "include \$RULE_PATH/community.rules" /etc/snort/snort.conf; then
echo "include \$RULE_PATH/community.rules" | maybe_sudo tee -a /etc/snort/snort.conf
success_message "Snort rule files configured on Linux"
fi
Expand Down

0 comments on commit 33e7c54

Please sign in to comment.