From b6cb104e289c8b5b9c8ab09cb0371aead097bb4e Mon Sep 17 00:00:00 2001 From: casjay Date: Sun, 14 Jul 2024 20:09:18 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/functions/entrypoint.sh --- rootfs/usr/local/etc/docker/functions/entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index d6f0d15..935049a 100755 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -465,10 +465,15 @@ __exec_command() { local exitCode="0" local cmdExec="${arg:-}" 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 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 elif [ -f "$prog" ] && [ ! -x "$prog" ]; then echo "$prog is not executable"