|
@@ -23,3 +23,15 @@ function gpg-stash-unmount()
|
|
|
{
|
|
|
(cd ~/.configs/gpg-stash && ./run.sh -r)
|
|
|
}
|
|
|
+
|
|
|
+function switch-yubikeys()
|
|
|
+{
|
|
|
+ # Running any decrypt, auth or sign will now ask you to insert Yubikey2
|
|
|
+ # To switch to Yubikey1 at any time run this script to force GPG
|
|
|
+ # to repoint the key stubs to the inserted Yubikey
|
|
|
+
|
|
|
+ read -p "Insert the Yubikey you want to use .... " ignore
|
|
|
+ echo "Switching GPG to backup Yubikey ..."
|
|
|
+
|
|
|
+ gpg-connect-agent "scd serialno" "learn --force" /bye
|
|
|
+}
|