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
       echo "Done unsetting ${keyname}."
78
       echo "Done unsetting ${keyname}."
79
     else
79
     else
80
       # add our custom local SSH key (make the key with ./make-anonymous-key)
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
       then
82
       then
83
         # if a stale socket already exists then throw an error
83
         # if a stale socket already exists then throw an error
84
         if [ -f "${sshagentsocket}" ]
84
         if [ -f "${sshagentsocket}" ]
90
         # start a new SSH agent just for this session
90
         # start a new SSH agent just for this session
91
         eval $(ssh-agent -a "${sshagentsocket}")
91
         eval $(ssh-agent -a "${sshagentsocket}")
92
         # add the key
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
       else
99
       else
95
         gitnonymous_error_missing "SSH config in ${sshdir} not found!"
100
         gitnonymous_error_missing "SSH config in ${sshdir} not found!"
96
         return 3
101
         return 3

+ 1
- 1
gitnonymous-setup View File

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

Loading…
Cancel
Save