-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
48 lines (37 loc) · 1012 Bytes
/
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
set -eo pipefail
trap _fn_terminate SIGINT SIGTERM ERR EXIT
# shellcheck disable=SC1091
source /usr/local/share/certs/scripts/import.bash
_fn_env_file() {
if [[ -n "${ENV_FILE}" ]]; then
set -a
# shellcheck disable=SC1090
source "${ENV_FILE}"
set +a
fi
}
_fn_terminate() {
ERROR_CODE="$?"
echo "CONTAINER > ERROR CODE: ${ERROR_CODE}"
exit "${ERROR_CODE}"
}
main() {
_fn_env_file
_fn_import /usr/local/share/certs/providers "DNS Provider"
_fn_import /usr/local/share/certs/scripts "Script Library"
# shellcheck disable=SC2034
if [[ "${TEST_MODE}" == "1" ]]; then
TEST_MODE="--test-cert"
else
TEST_MODE="-q"
fi
_fn_create # Create initial certificates
_fn_users # Configure users and passwords
_fn_renew & # Start certificate renewal process
_fn_config & # Start deferred configuration update
_fn_dkim & # Start deferred dkim update process
echo "CONTAINER > Starting postfix ..."
./docker-entrypoint.sh "$@"
}
main "$@"