From 42e943b1a8ab09954f05e4e56f6ee032a173f407 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 22 Aug 2018 10:33:42 +0200 Subject: [PATCH] Minor fixes Signed-off-by: Knut Ahlers --- bin/vault-sshadd | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/vault-sshadd b/bin/vault-sshadd index b50667a..73c0121 100755 --- a/bin/vault-sshadd +++ b/bin/vault-sshadd @@ -1,7 +1,5 @@ #!/bin/bash - -set -e -set -o pipefail +set -euo pipefail source "${HOME}/bin/script_framework.sh" @@ -22,8 +20,8 @@ chmod 0700 ${HELPER} trap "rm ${HELPER}" EXIT cat -s <${HELPER} -#!/bin/bash -vault read -field=private "/secret/ssh-key/\$1" | exec ssh-add -t 3600 - +#!/bin/bash -eu +vault read -field=private "secret/ssh-key/\$1" | exec ssh-add -t 3600 - EOF for KEY_NAME in $@; do @@ -36,7 +34,7 @@ for KEY_NAME in $@; do fi # Retrieve key from LastPass - PWD=$(vault read -field=passphrase "/secret/ssh-key/${KEY_NAME}") + PWD=$(vault read -field=passphrase "secret/ssh-key/${KEY_NAME}") # In case LastPass exitted non-zero we have no password if ! [ $? -eq 0 ]; then error "[${KEY_NAME}] Unable to get password. Not trying to unlock."