Skip to content

Commit

Permalink
Prevent loop break on regular exit
Browse files Browse the repository at this point in the history
  • Loading branch information
efrecon committed Feb 16, 2024
1 parent 3d5c0df commit 40b9840
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions runner/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ runner_unregister() {
verbose "Removed runner token file at $RUNNER_TOKENFILE"
fi

if [ -n "${RUNNER_TOKENFILE:-}" ] && [ -n "${RUNNER_SECRET:-}" ]; then
if [ "${1:-0}" = 1 ] && [ -n "${RUNNER_TOKENFILE:-}" ] && [ -n "${RUNNER_SECRET:-}" ]; then
printf %s\\n "$RUNNER_SECRET" > "${RUNNER_TOKENFILE%.*}.brk"
fi
}
Expand Down Expand Up @@ -394,7 +394,8 @@ if [ "$#" = 0 ]; then
fi

# Capture termination signals
trap runner_unregister INT TERM EXIT
trap 'runner_unregister 1' INT TERM
trap 'runner_unregister 0' EXIT

# Start the docker daemon. Prefer podman if available (it will be the only one
# available, unless the dockerd is installed in the future)
Expand Down

0 comments on commit 40b9840

Please sign in to comment.