if LASTPASS_USER env not found, prompt for username
This commit is contained in:
parent
790fee5e50
commit
ae3bb3bb4f
|
@ -50,4 +50,4 @@
|
|||
AUTHOR
|
||||
James Tomasino
|
||||
|
||||
version 2019.04.18 18 Apr 2019 LSSH(1)
|
||||
version 2019.12.25 25 Dec 2019 LSSH(1)
|
||||
|
|
14
lssh
14
lssh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
version="2019.04.22"
|
||||
version="2019.12.25"
|
||||
arg_options="hv"
|
||||
key=""
|
||||
|
||||
|
@ -105,9 +105,15 @@ main () {
|
|||
fi
|
||||
|
||||
# If not logged into lastpass, do so now
|
||||
if ! lpass status -q; then
|
||||
lpass login --trust "${LASTPASS_USER}"
|
||||
fi
|
||||
while ! lpass status -q; do
|
||||
if [ -z "${LASTPASS_USER}" ]; then
|
||||
printf "Lastpass Username: "
|
||||
read -r lpass_user
|
||||
lpass login --trust "${lpass_user}"
|
||||
else
|
||||
lpass login --trust "${LASTPASS_USER}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Retrieve key from LastPass. If logged in but not recently authenticated
|
||||
# lastpass will prompt with pinentry. If no entry found, suppress error.
|
||||
|
|
Loading…
Reference in New Issue