From cd2d569158299d5c4d1ffb50270b1e274f5b8e80 Mon Sep 17 00:00:00 2001 From: Brian Munro Date: Tue, 8 Mar 2022 11:49:02 +0200 Subject: [PATCH] added if statement to notice about new API key, if cscli is not available don't show it. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ea7243b..7a9f8f1 100755 --- a/install.sh +++ b/install.sh @@ -66,7 +66,7 @@ gen_config_file() { API_KEY=$(cscli bouncers add "crowdsec-openresty-bouncer-${SUFFIX}" -o raw) fi API_KEY=${API_KEY} CROWDSEC_LAPI_URL="http://127.0.0.1:8080" envsubst < ./config/config_example.conf > "${CONFIG_PATH}/crowdsec-openresty-bouncer.conf" - echo "New API key generated to be used in '${CONFIG_PATH}/crowdsec-openresty-bouncer.conf'" + [ -n "${API_KEY}" ] && echo "New API key generated to be used in '${CONFIG_PATH}/crowdsec-openresty-bouncer.conf'" else #Patch the existing file with new parameters if the need to be added echo "Patch crowdsec-openresty-bouncer.conf .."