Skip to content

Commit 7b71d2b

Browse files
authored
fix: if user script is executable, execute it (#21)
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
1 parent a11d539 commit 7b71d2b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

bin/entrypoint

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ fi
2626

2727
# Execute user startup script if it exists
2828
if [[ -e ${USER_STARTUP_SCRIPT} ]]; then
29-
bash ${USER_STARTUP_SCRIPT}
29+
__ret=0
30+
if [[ -x ${USER_STARTUP_SCRIPT} ]]; then
31+
${USER_STARTUP_SCRIPT}
32+
__ret=$?
33+
else
34+
chmod a+x ${USER_STARTUP_SCRIPT} || ls -l ${USER_STARTUP_SCRIPT}
35+
${USER_STARTUP_SCRIPT}
36+
__ret=$?
37+
fi
38+
if [[ ${__ret} -ne 0 ]]; then
39+
echo "WARN: User startup script exited with error code ${__ret}" >&2
40+
fi
3041
fi
3142

3243
# Redirect output to /dev/null unless in debug mode

0 commit comments

Comments
 (0)