summaryrefslogtreecommitdiffstats
path: root/request_cert.sh
diff options
context:
space:
mode:
Diffstat (limited to 'request_cert.sh')
-rw-r--r--request_cert.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/request_cert.sh b/request_cert.sh
index a3d37e2..9ddf042 100644
--- a/request_cert.sh
+++ b/request_cert.sh
@@ -12,7 +12,9 @@
# Simple Usage: request_cert.sh -s <fqdn>
#
-if [ -z "${VAULT_TOKEN}" ]; then
+set -eu
+
+if [ -z "${VAULT_TOKEN-}" ]; then
read -p USER: LDAPUSER
read -s -p PASSWORD: LPDAPASSWD
VAULT_TOKEN=$( curl -s -X POST -H "Content-Type: application/json" -d "{ \"password\": \"$LPDAPASSWD\"}" https://vault.dings:8200/v1/auth/ldap/login/$LDAPUSER | jq -r ".auth.client_token" )
@@ -20,7 +22,7 @@ if [ -z "${VAULT_TOKEN}" ]; then
fi
-if [ -z "$1" ]; then
+if [ -z "${1-}" ]; then
echo "USAGE: $0 -s <fqdn>|<filename>"
exit 1
fi