From 184ca403ab138ac7e96cd72927afeaa5f1ebb5fd Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Mon, 8 Jun 2020 11:24:51 +0200 Subject: Redo lpass in a case --- .local/bin/lpass | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to '.local') 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 "$@" -- cgit v1.1