summarylogtreecommitdiffstats
path: root/cs-firewall-bouncer.install
diff options
context:
space:
mode:
authorsmac892023-10-12 00:38:34 -0600
committersmac892023-10-12 00:38:34 -0600
commit34cb35b8466b602db04fc02f8f1a6162a5860291 (patch)
treeaeb3ddd0a6e1e2f8ee59cc3a61f9e06a7caa0c77 /cs-firewall-bouncer.install
parentc927b1a4f37353d9012953675cb64eb9e36d04da (diff)
downloadaur-crowdsec-firewall-bouncer.tar.gz
fix sed command in install
Diffstat (limited to 'cs-firewall-bouncer.install')
-rw-r--r--cs-firewall-bouncer.install6
1 files changed, 4 insertions, 2 deletions
diff --git a/cs-firewall-bouncer.install b/cs-firewall-bouncer.install
index b120eae414f4..24426cb943a0 100644
--- a/cs-firewall-bouncer.install
+++ b/cs-firewall-bouncer.install
@@ -9,7 +9,7 @@ post_install() {
IFS=: read HOST PORT <<< `cscli config show --key "Config.API.Server.ListenURI"`
export CROWDSEC_LAPI_URL="http://${HOST:-'127.0.0.1'}:${PORT:-'8080'}"
- sed -iE "s|^(api_url\s*:).*|\1 $CROWDSEC_LAPI_URL|" /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml
+ sed -Ei "s|^(api_url\s*:).*|\1 $CROWDSEC_LAPI_URL|" /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml
systemctl daemon-reload
systemctl enable --now crowdsec-firewall-bouncer
@@ -22,5 +22,7 @@ post_remove() {
fi
systemctl daemon-reload
- systemctl disable --now crowdsec-firewall-bouncer
+ if systemctl is-enabled -q crowdsec-firewall-bouncer; then
+ systemctl disable --now crowdsec-firewall-bouncer
+ fi
}