🗃️ Committing everything that changed 🗃️

rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
casjay 2024-07-14 20:07:45 -04:00
parent c472895187
commit 3b69db287f
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -465,10 +465,15 @@ __exec_command() {
local exitCode="0" local exitCode="0"
local cmdExec="${arg:-}" local cmdExec="${arg:-}"
prog_bin="$(echo "${arg[@]}" | tr ' ' '\n' | grep -v '^$' | head -n1 || echo '')" prog_bin="$(echo "${arg[@]}" | tr ' ' '\n' | grep -v '^$' | head -n1 || echo '')"
[ -n "$prog_bin" ] && prog="$(type -P "${prog_bin}" 2>/dev/null || echo ':ERROR:')" || prog="bash" [ -n "$prog_bin" ] && prog="$(type -P "$prog_bin" 2>/dev/null || echo "$1")" || prog="bash"
cmdExec="$prog $cmdExec"
if [ -f "$prog" ]; then if [ -f "$prog" ]; then
echo "${exec_message:-Executing command: $cmdExec}" echo "${exec_message:-Executing command: $cmdExec}"
eval $cmdExec || exitCode=1 if [ -x "/bin/bash" ]; then
eval bash -c "$cmdExec" || exitCode=1
else
eval sh -c "$cmdExec" || exitCode=1
fi
[ "$exitCode" = 0 ] || exitCode=10 [ "$exitCode" = 0 ] || exitCode=10
elif [ -f "$prog" ] && [ ! -x "$prog" ]; then elif [ -f "$prog" ] && [ ! -x "$prog" ]; then
echo "$prog is not executable" echo "$prog is not executable"