diff --git a/autostart/configure-blackfire-cli.sh-example b/autostart/configure-blackfire-cli.sh-example index 344b1826..9cece3e3 100755 --- a/autostart/configure-blackfire-cli.sh-example +++ b/autostart/configure-blackfire-cli.sh-example @@ -5,6 +5,15 @@ set -u set -o pipefail +### +### Pre-flight check +### +if ! command -v blackfire >/dev/null 2>&1; then + echo "No blackfire cli found, skipping configuration." + exit 0 +fi + + ### ### Blackfire Client (cli) Variables ### @@ -12,7 +21,8 @@ set -o pipefail BF_CLIENT_ID= # Blackfire Client Token via env: BLACKFIRE_SERVER_TOKEN BF_CLIENT_TOKEN= - +# Blackfire client configuration file +BF_CLIENT_INI="/home/devilbox/.blackfire.ini" ### ### Get Client ID and Client Token @@ -76,7 +86,7 @@ fi echo "; desc : Sets the Blackfire API connection timeout"; echo "; default: 15s"; echo "timeout=15s"; -} > /home/devilbox/.blackfire.ini +} > "${BF_CLIENT_INI}" -chown devilbox:devilbox /home/devilbox/.blackfire.ini -chmod 0600 /home/devilbox/.blackfire.ini +chown devilbox:devilbox "${BF_CLIENT_INI}" +chmod 0600 "${BF_CLIENT_INI}"