Skip to content

Commit

Permalink
Added safegards for variable beeing set
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarriosjr committed Feb 22, 2023
1 parent ddc6e84 commit 89a53d4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#!/bin/sh
if [ -z "$NOMAD_JOB" ];
then
echo "NOMAD_JOB variable requiered."
exit 2
fi

if [ -z "$NOMAD_ADDR" ];
then
NOMAD_ADDR = "http://127.0.0.1"
fi

if [ -z "$NOMAD_PORT" ];
then
NOMAD_PORT = "4646"
fi

if ! command -v nomad &> /dev/null
then
Expand Down

0 comments on commit 89a53d4

Please sign in to comment.