22 lines
417 B
Bash
Executable File
22 lines
417 B
Bash
Executable File
#!/bin/bash
|
|
set -eu
|
|
|
|
gpg2 --version >/dev/null # verify that GnuPG 2 is installed
|
|
|
|
export GNUPGHOME=~/.gnupg/trezor
|
|
|
|
# Make sure that the device is unlocked before starting the shell
|
|
trezor-gpg-unlock
|
|
|
|
# Make sure TREZOR-based gpg-agent is running
|
|
gpg-connect-agent --agent-program "$(which trezor-gpg-agent)" </dev/null
|
|
|
|
COMMAND=$*
|
|
if [ -z "${COMMAND}" ]
|
|
then
|
|
gpg2 --list-public-keys
|
|
${SHELL}
|
|
else
|
|
${COMMAND}
|
|
fi
|