diff --git a/debian/control b/debian/control index 8f812de54..b2d2bac20 100644 --- a/debian/control +++ b/debian/control @@ -5,3 +5,4 @@ Build-Depends: debhelper, jq, bash, git Package: crowdsec Architecture: any Description: Crowdsec - An open-source, lightweight agent to detect and respond to bad behaviours. It also automatically benefits from our global community-wide IP reputation database +Depends: coreutils \ No newline at end of file diff --git a/debian/postinst b/debian/postinst index 5c741aa55..7055e12f5 100644 --- a/debian/postinst +++ b/debian/postinst @@ -89,10 +89,11 @@ if [ "$1" = configure ]; then systemctl --quiet is-enabled crowdsec || systemctl unmask crowdsec && systemctl enable crowdsec - if [ -z "$(ss -nlt 'sport = 8080' | grep -v ^State)" ] || [ "$LAPI" = false ]; then + PORT=$(cscli config show --key "Config.API.Server.ListenURI"|cut -d ":" -f2) + if [ -z "$(ss -nlt "sport = ${PORT}" | grep -v ^State)" ] || [ "$LAPI" = false ] ; then systemctl start crowdsec else - echo "Not attempting to start crowdsec, port 8080 is already used or lapi was disabled" + echo "Not attempting to start crowdsec, port ${PORT} 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