#! /usr/bin/env sh readonly BIN=/usr/bin/lpass main() { # Password is stored in pass, read it from there when trying to login if [ "$1" = "login" ] then shift export LPASS_DISABLE_PINENTRY=1 export LPASS_AGENT_TIMEOUT=86400 pass show "websites/lastpass.com/$1" | "$BIN" login --trust "$@" return fi # Hand off execution to the regular binary exec "$BIN" "$@" } main "$@"