aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/lpass
blob: 1362ad1cd6d48f1f89ef669080bad23f019b831d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /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
		export LPASS_DISABLE_PINENTRY=1
		shift

		pass show "websites/lastpass.com/$1" | "$BIN" login --trust "$@"
		return
	fi

	# Hand off execution to the regular binary
	exec "$BIN" "$@"
}

main "$@"