Browse Source

Use filename 'identity' for all key types.

This is to allow the use of other key types with the -t option.
E.g. -t ed25519

This change is backwards compatible with existing gitnonymous
identities.
master
Chris McCormick 5 years ago
parent
commit
fd98a1e96e
2 changed files with 8 additions and 3 deletions
  1. 7
    2
      gitnonymous
  2. 1
    1
      gitnonymous-setup

+ 7
- 2
gitnonymous View File

@@ -78,7 +78,7 @@ then
78 78
       echo "Done unsetting ${keyname}."
79 79
     else
80 80
       # add our custom local SSH key (make the key with ./make-anonymous-key)
81
-      if [ -f ${sshdir}/id_rsa ]
81
+      if [ -f ${sshdir}/id_rsa -o -f ${sshdir}/identity ]
82 82
       then
83 83
         # if a stale socket already exists then throw an error
84 84
         if [ -f "${sshagentsocket}" ]
@@ -90,7 +90,12 @@ then
90 90
         # start a new SSH agent just for this session
91 91
         eval $(ssh-agent -a "${sshagentsocket}")
92 92
         # add the key
93
-        ssh-add ${sshdir}/id_rsa
93
+        if [ -f ${sshdir}/id_rsa ]
94
+        then
95
+          ssh-add ${sshdir}/id_rsa
96
+        else
97
+          ssh-add ${sshdir}/identity
98
+        fi
94 99
       else
95 100
         gitnonymous_error_missing "SSH config in ${sshdir} not found!"
96 101
         return 3

+ 1
- 1
gitnonymous-setup View File

@@ -16,7 +16,7 @@ unset _GITNONYMOUS_SRC
16 16
 
17 17
 # set up our other variables
18 18
 confdir="${HOME}/.gitnonymous-${1}"
19
-sshfile="${confdir}/ssh/id_rsa"
19
+sshfile="${confdir}/ssh/identity"
20 20
 configfile="${confdir}/config"
21 21
 sshwrapperfile="${confdir}/git-ssh-wrap"
22 22
 

Loading…
Cancel
Save