Skip to content

Commit 442727f

Browse files
committed
address some shellcheck linking failures
We forgot to run shellcheck on PR #737. Oops.
1 parent bb64864 commit 442727f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packer/linux/conf/buildkite-agent/scripts/stop-agent-gracefully

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ if [[ $LIFECYCLE_TRANSITION = "ec2:SPOT_INSTANCE_TERMINATION" ]]; then
1717
# Spot termination time is provided as the third argument in RFC3339 format,
1818
# i.e. 2020-10-09T01:33:10Z
1919
SPOT_TERMINATION_TIME=$3
20-
SPOT_TERMINATION_TIME_UNIX=$(date '+%s' -d ${SPOT_TERMINATION_TIME})
20+
SPOT_TERMINATION_TIME_UNIX=$(date '+%s' -d "${SPOT_TERMINATION_TIME}")
2121
# Subtracts 20 seconds from the published spot termination time to give the
2222
# agent a little time to forcefully quit running jobs. If the agent doesn't
2323
# gracefully quit before this time we will send SIGQUIT.
24-
STOP_BY_TIME_UNIX=$(expr ${SPOT_TERMINATION_TIME_UNIX} - 20)
24+
STOP_BY_TIME_UNIX=$((SPOT_TERMINATION_TIME_UNIX - 20))
2525

2626
echo "Waiting for agents to quit gracefully until 20 seconds before the spot termination time: ${SPOT_TERMINATION_TIME}"
2727
while [[ $(date '+%s') -lt $STOP_BY_TIME_UNIX ]]; do

0 commit comments

Comments
 (0)