WIP: wip-entrypoint #2
1 changed files with 7 additions and 1 deletions
|
@ -4,7 +4,7 @@ set -e
|
||||||
|
|
||||||
# Technically not nessecary but it cleans up the logs from having token/secret values
|
# Technically not nessecary but it cleans up the logs from having token/secret values
|
||||||
run_command() {
|
run_command() {
|
||||||
local cmd="$1"
|
local cmd="$@"
|
||||||
# Replace any --token <value> or --secret <value> with [REDACTED]
|
# Replace any --token <value> or --secret <value> with [REDACTED]
|
||||||
local safe_cmd=$(echo "$cmd" | sed -E 's/--(token|secret) [^ ]+/--\1 [REDACTED]/g')
|
local safe_cmd=$(echo "$cmd" | sed -E 's/--(token|secret) [^ ]+/--\1 [REDACTED]/g')
|
||||||
decho "Running command: $safe_cmd"
|
decho "Running command: $safe_cmd"
|
||||||
|
@ -23,6 +23,12 @@ if [[ $(id -u) -eq 0 ]]; then
|
||||||
decho "[WARNING] Running as root user"
|
decho "[WARNING] Running as root user"
|
||||||
fi
|
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
|
# Handle and alter the config file
|
||||||
if [[ -z "${CONFIG_FILE}" ]]; then
|
if [[ -z "${CONFIG_FILE}" ]]; then
|
||||||
echo "CONFIG_FILE is not set"
|
echo "CONFIG_FILE is not set"
|
||||||
|
|
Loading…
Reference in a new issue