From 7cea93d1414a0f936f586c7ab4660da7f003e055 Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Fri, 19 Mar 2021 22:10:54 +0000 Subject: [PATCH] refactor: simpler sed --- src/script.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/script.sh b/src/script.sh index 6ed46f2e..d250b16d 100644 --- a/src/script.sh +++ b/src/script.sh @@ -265,20 +265,14 @@ done < "phishing-url-top-domains-raw.txt" set -x -cat "../dist/phishing-filter-snort2.rules" | \ -sed '1 i\'"$COMMENT"'' | \ -sed "1s/Domains Blocklist/URL Snort2 Ruleset/" > "../dist/phishing-filter-snort2.rules.temp" -mv "../dist/phishing-filter-snort2.rules.temp" "../dist/phishing-filter-snort2.rules" +sed -i '1 i\'"$COMMENT"'' "../dist/phishing-filter-snort2.rules" +sed -i "1s/Domains Blocklist/URL Snort2 Ruleset/" "../dist/phishing-filter-snort2.rules" -cat "../dist/phishing-filter-snort3.rules" | \ -sed '1 i\'"$COMMENT"'' | \ -sed "1s/Domains Blocklist/URL Snort3 Ruleset/" > "../dist/phishing-filter-snort3.rules.temp" -mv "../dist/phishing-filter-snort3.rules.temp" "../dist/phishing-filter-snort3.rules" +sed -i '1 i\'"$COMMENT"'' "../dist/phishing-filter-snort3.rules" +sed -i "1s/Domains Blocklist/URL Snort3 Ruleset/" "../dist/phishing-filter-snort3.rules" -cat "../dist/phishing-filter-suricata.rules" | \ -sed '1 i\'"$COMMENT"'' | \ -sed "1s/Domains Blocklist/URL Suricata Ruleset/" > "../dist/phishing-filter-suricata.rules.temp" -mv "../dist/phishing-filter-suricata.rules.temp" "../dist/phishing-filter-suricata.rules" +sed -i '1 i\'"$COMMENT"'' "../dist/phishing-filter-suricata.rules" +sed -i "1s/Domains Blocklist/URL Suricata Ruleset/" "../dist/phishing-filter-suricata.rules" ## IE blocklist