diff --git a/root/check-one-shot.sh b/root/check-one-shot.sh index 1808062..1afe99e 100644 --- a/root/check-one-shot.sh +++ b/root/check-one-shot.sh @@ -4,6 +4,7 @@ if [ $ONE_SHOT == "true" ]; then # Cleanly kill container by sending kill signal to supervisor process - kill 1 + echo 0 > /run/s6-linux-init-container-results/exitcode + /run/s6/basedir/bin/halt fi \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/cron/finish b/root/etc/s6-overlay/s6-rc.d/cron/finish index 767f815..a6cb9ce 100644 --- a/root/etc/s6-overlay/s6-rc.d/cron/finish +++ b/root/etc/s6-overlay/s6-rc.d/cron/finish @@ -1 +1,9 @@ -echo "$e" > /run/s6-linux-init-container-results/exitcode \ No newline at end of file +#!/command/with-contenv bash +# shellcheck shell=bash + +if [ $ONE_SHOT == "false" ]; then + + # Export exit code if not a ONE_SHOT + echo "$e" > /run/s6-linux-init-container-results/exitcode + +fi \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/logs/finish b/root/etc/s6-overlay/s6-rc.d/logs/finish index 767f815..a6cb9ce 100644 --- a/root/etc/s6-overlay/s6-rc.d/logs/finish +++ b/root/etc/s6-overlay/s6-rc.d/logs/finish @@ -1 +1,9 @@ -echo "$e" > /run/s6-linux-init-container-results/exitcode \ No newline at end of file +#!/command/with-contenv bash +# shellcheck shell=bash + +if [ $ONE_SHOT == "false" ]; then + + # Export exit code if not a ONE_SHOT + echo "$e" > /run/s6-linux-init-container-results/exitcode + +fi \ No newline at end of file