diff options
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/lpass | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/.local/bin/lpass b/.local/bin/lpass index ff2b076..67dbaae 100755 --- a/.local/bin/lpass +++ b/.local/bin/lpass @@ -4,21 +4,24 @@ readonly BIN=/usr/bin/lpass main() { - # Password is stored in pass, read it from there when trying to login - if [ "$1" = "login" ] - then - shift + case "$1" in + login) + # Password is stored in pass, read it from there when + # trying to login + shift - export LPASS_DISABLE_PINENTRY=1 - export LPASS_AGENT_TIMEOUT=86400 + export LPASS_DISABLE_PINENTRY=1 + export LPASS_AGENT_TIMEOUT=86400 - pass show "websites/lastpass.com/$1" | "$BIN" login --trust "$@" + pass show "websites/lastpass.com/$1" | "$BIN" login --trust "$@" - return - fi - - # Hand off execution to the regular binary - exec "$BIN" "$@" + return + ;; + *) + # Hand off execution to the regular binary + exec "$BIN" "$@" + ;; + esac } main "$@" |