-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
48 lines (42 loc) · 1.01 KB
/
entrypoint.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
case "$1" in
'bash')
exec bash
;;
'gen-key')
if [ "random" = "$PASSPHRASE" ]; then
PASSPHRASE=$(pwgen 16 1)
fi
cat << EOF | gpg --batch --gen-key
%echo Generating a key
Key-Type: $KEY_TYPE
Key-Length: $KEY_LENGTH
Subkey-Type: $SUBKEY_TYPE
Subkey-Length: $SUBKEY_LENGTH
Name-Real: $NAME_REAL
Name-Email: $NAME_EMAIL
Expire-Date: 0
Passphrase: $PASSPHRASE
%commit
%echo Created key with passphrase '$PASSPHRASE'
EOF
exit
;;
'/bin/bash')
exec cat << EOF
This is the duply docker container.
Please specify a command:
bash
Open a command line prompt in the container.
gen-key
Create a GPG key to be used with duply.
usage
Show duply's usage help.
All other commands will be interpreted as commands to duply.
EOF
;;
*)
DUPL_PARAMS="$DUPL_PARAMS --allow-source-mismatch"
exec duply "$@"
;;
esac