diff --git a/consul-bootstrap.sh b/consul-bootstrap.sh index 900edf7..cda1f2c 100755 --- a/consul-bootstrap.sh +++ b/consul-bootstrap.sh @@ -8,6 +8,11 @@ # exit on error set -e +if [ "$#" -eq 0 ] + echo "No options specified, exiting." + exit 1 +fi + # create directory if doesn't exist and set permissions mkdir -p /etc/consul.d/ && chown -R consul:consul /etc/consul.d/ @@ -43,10 +48,6 @@ consultype="client" bind_ip=null server_ip=null -if [ "$#" -eq 0 ] - echo "No options specified, exiting." - exit 1 - # read parameters while [[ "$#" -gt 0 ]] do