-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·31 lines (25 loc) · 806 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·31 lines (25 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
usage="Usage:
docker run --rm \\
--volume=/path/to/file.ppk:/tmp/id.ppk \\
--volume=/path/to/output:/tmp/out/ \\
czerasz/putty-tools
where:
/path/to/file.ppk - local path to your ppk file
/path/to/output - local path to where the private and public key should be placed"
if [ ! -f "/tmp/id.ppk" ]; then
echo -e "Error: /tmp/id.ppk not specified\n"
echo "$usage"
echo -e "\nTip: Please mount the /tmp/id.ppk file"
exit 1
fi
if [ ! -d "/tmp/out" ]; then
echo -e "Error: /tmp/out doesn't exist\n"
echo "$usage"
echo -e "\nTip: Please mount the /tmp/out directory"
exit 2
fi
# Extract private key
puttygen /tmp/id.ppk -O private-openssh -o /tmp/out/key
# Extract public key
puttygen /tmp/id.ppk -O public-openssh -o /tmp/out/key.pub