From 66919924d316ad1f594a642a9ce180e034cfe8da Mon Sep 17 00:00:00 2001 From: blotus Date: Fri, 22 Oct 2021 10:49:44 +0200 Subject: [PATCH] don't attempt to start crowdsec if LAPI has been disabled with debconf (#1016) --- debian/postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index 4705b8df4..05b1a0c0a 100644 --- a/debian/postinst +++ b/debian/postinst @@ -89,10 +89,10 @@ if [ "$1" = configure ]; then systemctl --quiet is-enabled crowdsec || systemctl unmask crowdsec && systemctl enable crowdsec - if [ -z "$(ss -nlt 'sport = 8080' | grep -v ^State)" ]; then + if [ -z "$(ss -nlt 'sport = 8080' | grep -v ^State)" ] || [ "$LAPI" = false ]; then systemctl start crowdsec else - echo "Not attempting to start crowdsec, port 8080 is already used" + echo "Not attempting to start crowdsec, port 8080 is already used or lapi was disabled" echo "This port is configured through /etc/crowdsec/config.yaml and /etc/crowdsec/local_api_credentials.yaml" fi fi