summary refs log tree commit diff stats
path: root/bin/gk
blob: 942a89067e6829b5ea7f5bd0a9c6f03acb4230a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

PARAM="$1"

pkill -9 gpg-agent

export GPG_TTY=$(tty)
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)

if [ "$PARAM" = "switch" ]; then
  gpg-connect-agent "scd serialno" "learn --force" /bye
fi

gpg-connect-agent updatestartuptty /bye
gpgconf --create-socketdir