Skip to content

Commit

Permalink
fix(chore): add missing sed_alternative command
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmandMeppa committed Dec 18, 2024
1 parent 69acefb commit bac5604
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ maybe_sudo() {

sed_alternative() {
if command_exists gsed; then
gsed "$@"
maybe_sudo gsed "$@"
else
sed "$@"
maybe_sudo sed "$@"
fi
}

Expand Down Expand Up @@ -107,7 +107,7 @@ revert_ossec_conf() {
local snort_tag="<!-- snort -->"

if maybe_sudo grep -q "$snort_tag" "$ossec_conf"; then
maybe_sudo sed_alternative -i "/$snort_tag/,/<\/localfile>/d" "$ossec_conf"
sed_alternative -i "/$snort_tag/,/<\/localfile>/d" "$ossec_conf"
info_message "Reverted changes in $ossec_conf"
else
info_message "No Snort-related changes found in $ossec_conf"
Expand Down

0 comments on commit bac5604

Please sign in to comment.