aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-06-08 11:24:51 +0200
committerPatrick Spek <p.spek@tyil.nl>2021-08-14 11:59:38 +0200
commit184ca403ab138ac7e96cd72927afeaa5f1ebb5fd (patch)
treee405e9e0c1c27883e94a46d7aa8aa57759412c0f /.local
parent5b39e24287056be98887c4ab637b907ac68138bb (diff)
Redo lpass in a case
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/lpass27
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 "$@"