diff --git a/entrypoint.sh b/entrypoint.sh index 64ec4f7..db9291f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ set -e # Technically not nessecary but it cleans up the logs from having token/secret values run_command() { - local cmd="$1" + local cmd="$@" # Replace any --token or --secret with [REDACTED] local safe_cmd=$(echo "$cmd" | sed -E 's/--(token|secret) [^ ]+/--\1 [REDACTED]/g') decho "Running command: $safe_cmd" @@ -23,6 +23,12 @@ if [[ $(id -u) -eq 0 ]]; then decho "[WARNING] Running as root user" fi +# Handle if `command` is passed, as command appends arguments to the entrypoint +if [ "$#" -gt 0 ]; then + run_command "$@" + exit +fi + # Handle and alter the config file if [[ -z "${CONFIG_FILE}" ]]; then echo "CONFIG_FILE is not set"