-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetupkeys.sh
More file actions
executable file
·18 lines (14 loc) · 676 Bytes
/
setupkeys.sh
File metadata and controls
executable file
·18 lines (14 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# setupkeys.sh - set up keys for signing
# Copyright (C) 2020 Kaz Nishimura
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
export GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg}
mkdir -p -m go-rwx "$GNUPGHOME"
echo allow-preset-passphrase >> "$GNUPGHOME"/gpg-agent.conf || exit $?
gpg --import --batch "$1" || exit $?
keygrip=`gpg --list-secret-keys --with-colons "$GPG_KEYNAME" | \
awk -F : '$1 == "grp" { print $10 }'`
exec /usr/lib/gnupg/gpg-preset-passphrase --preset "$keygrip"