|
@@ -22,16 +22,18 @@ sshwrapperfile="${confdir}/git-ssh-wrap"
|
22
|
22
|
|
23
|
23
|
if [ "$1" = "" -o '-h' = "$1" -o '--help' = "$1" ]
|
24
|
24
|
then
|
25
|
|
- echo "Usage: $0 KEYNAME"
|
|
25
|
+ echo "Usage: $0 KEYNAME [SSH-KEYGEN-PARAMETERS]"
|
26
|
26
|
else
|
27
|
|
- comment="${1}@anonymous"
|
|
27
|
+ id="${1}"
|
|
28
|
+ shift
|
|
29
|
+ comment="id@anonymous"
|
28
|
30
|
echo "-> Creating ${confdir}."
|
29
|
31
|
mkdir -p "${confdir}/ssh"
|
30
|
32
|
echo "-> Creating SSH key '${sshfile}'."
|
31
|
33
|
echo "SSH key comment (public) is '${comment}'."
|
32
|
|
- ssh-keygen -C "${comment}" -f "${sshfile}"
|
|
34
|
+ ssh-keygen -C "${comment}" -f "${sshfile}" "$@"
|
33
|
35
|
echo "-> Creating SSH wrapper '${sshwrapperfile}'."
|
34
|
|
- cat "${dir}/git-ssh-wrap" | sed "s/KEYNAME/${1}/" > "${sshwrapperfile}"
|
|
36
|
+ cat "${dir}/git-ssh-wrap" | sed "s/KEYNAME/${id}/" > "${sshwrapperfile}"
|
35
|
37
|
chmod 755 "${sshwrapperfile}"
|
36
|
38
|
echo "-> Creating config file '${configfile}'."
|
37
|
39
|
cp ${dir}/config "${configfile}"
|