Browse Source

Merge branch 'master' of git.matevi.sh:ramatevish/sh-common

R. Alex Matevish 2 years ago
parent
commit
777a2292a8
2 changed files with 14 additions and 0 deletions
  1. 2 0
      git.sh
  2. 12 0
      pgp.sh

+ 2 - 0
git.sh

@@ -4,6 +4,8 @@
 #
 ##############################################################################
 if command_exists git; then
+    git config --global user.signingkey 0E669F3125C0EDB2C8B040E49D7B2F1E705D7EFC
+    git config --global commit.gpgsign true
 
     git config --global alias.a add
     git config --global alias.b branch

+ 12 - 0
pgp.sh

@@ -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
+}