don't attempt to start crowdsec if LAPI has been disabled with debconf (#1016)

This commit is contained in:
blotus 2021-10-22 10:49:44 +02:00 committed by GitHub
parent a7b1c02bd5
commit 66919924d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
debian/postinst vendored
View file

@ -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