From 514f6366920fe5872b5aa3812cfca32538f91dc7 Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Sat, 8 Jan 2022 20:40:30 +0530 Subject: [PATCH] add help option --- consul-bootstrap.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/consul-bootstrap.sh b/consul-bootstrap.sh index 5d137e9..7ce2571 100755 --- a/consul-bootstrap.sh +++ b/consul-bootstrap.sh @@ -8,10 +8,15 @@ # exit on error set -e -if [ "$#" -eq 0 ] -then +if [ "$#" -eq 0 ]; then echo "No options specified, exiting." exit 1 +elif [ "$#" -eq 1 ] && [ "$1" == "-h" ]; then + echo "HashiCorp Consul Bootstrap Script. Provide:" + echo "-server for server install," + echo "-bind for the bind interface address," + echo "-server-ip for the server ip address." + exit 1 fi # create directory if doesn't exist and set permissions