Rev 61 | Rev 74 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 61 | Rev 62 | ||
---|---|---|---|
Line 43... | Line 43... | ||
43 | 43 | ||
44 | if [ ! -f "$HOST_KEY" ]; then |
44 | if [ ! -f "$HOST_KEY" ]; then |
45 | if [ -r "$OPENSSH_HOST_KEY" ]; then |
45 | if [ -r "$OPENSSH_HOST_KEY" ]; then |
46 | echo -n "Converting existing OpenSSH RSA host key ... " |
46 | echo -n "Converting existing OpenSSH RSA host key ... " |
47 | if pkcs1-conv < "$OPENSSH_HOST_KEY" | lsh-writekey --server && |
47 | if pkcs1-conv < "$OPENSSH_HOST_KEY" | lsh-writekey --server && |
48 | [ -f "$HOST_KEY" ]; then |
48 | [ -f "$HOST_KEY" -a -f "$HOST_KEY.pub" ]; then |
- | 49 | chmod +r "$HOST_KEY.pub" |
|
49 | echo -n "done." |
50 | echo "done." |
50 | return 0 |
51 | return 0 |
51 | fi |
52 | fi |
- | 53 | rm -f "$HOST_KEY" "$HOST_KEY.pub" |
|
52 | echo "failed. Will generate a new key instead." |
54 | echo "failed. Will generate a new key instead." |
53 | fi |
55 | fi |
54 | echo -n "Creating lsh host key ... " |
56 | echo -n "Creating lsh host key ... " |
55 | if lsh-keygen --server | lsh-writekey --server && |
57 | if lsh-keygen --server | lsh-writekey --server && |
- | 58 | [ -f "$HOST_KEY" -a -f "$HOST_KEY.pub" ]; then |
|
56 | [ -f "$HOST_KEY" ]; then |
59 | chmod +r "$HOST_KEY.pub" |
57 | echo " done." |
60 | echo "done." |
58 | else |
61 | else |
59 | echo " failed!" |
62 | echo "failed!" |
60 | return 1 |
63 | return 1 |
61 | fi |
64 | fi |
62 | fi |
65 | fi |
63 | return 0 |
66 | return 0 |
64 | } |
67 | } |