Skip to content

Commit 60d4e14

Browse files
committed
Appease shellcheck
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 6c7f8c2 commit 60d4e14

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

provisionersdk/scripts/bootstrap_darwin.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ export CODER_AGENT_AUTH="${AUTH_TYPE}"
3333
export CODER_AGENT_URL="${ACCESS_URL}"
3434

3535
output=$(./${BINARY_NAME} --version | head -n1)
36-
echo "${output}" | grep -q Coder
37-
if [ $? -ne 0 ] ; then
38-
echo >&2 "ERROR: Downloaded agent binary is invalid"
39-
echo >&2 "Script output: '${output}'"
40-
exit 2
36+
if ! echo "${output}" | grep -q Coder; then
37+
echo >&2 "ERROR: Downloaded agent binary is invalid"
38+
echo >&2 "Script output: '${output}'"
39+
exit 2
4140
fi
4241

4342
exec ./${BINARY_NAME} agent

provisionersdk/scripts/bootstrap_linux.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ export CODER_AGENT_AUTH="${AUTH_TYPE}"
8888
export CODER_AGENT_URL="${ACCESS_URL}"
8989

9090
output=$(./${BINARY_NAME} --version | head -n1)
91-
echo "${output}" | grep -q Coder
92-
if [ $? -ne 0 ] ; then
93-
echo >&2 "ERROR: Downloaded agent binary is invalid"
94-
echo >&2 "Script output: '${output}'"
95-
exit 2
91+
if ! echo "${output}" | grep -q Coder; then
92+
echo >&2 "ERROR: Downloaded agent binary is invalid"
93+
echo >&2 "Script output: '${output}'"
94+
exit 2
9695
fi
9796

9897
exec ./${BINARY_NAME} agent

0 commit comments

Comments
 (0)