Fix credentials short-circuits

This commit is contained in:
Lucas 2019-12-16 13:50:59 +00:00
parent be2b7edc4c
commit 8f00ffb6b8

View File

@ -57,12 +57,18 @@ get_from_flags()
pass=$3
sfa=$4
[ $user = yes ] && sekrit has services/"$service"/user ||
if [ $user = yes ]; then
sekrit has services/"$service"/user ||
err "Service \"$service\" has no user."
[ $pass = yes ] && sekrit has services/"$service"/pass ||
fi
if [ $pass = yes ]; then
sekrit has services/"$service"/pass ||
err "Service \"$service\" has no pass."
[ $sfa = yes ] && sekrit has services/"$service"/2fa ||
fi
if [ $sfa = yes ]; then
sekrit has services/"$service"/2fa ||
err "Service \"$service\" has no 2fa."
fi
[ $user = yes ] && get_user "$service"
[ $pass = yes ] && get_pass "$service"