1
0
docker-letsencrypt-nginx-pr.../app/start.sh
Nicolas Duchon 83174ed375 Shell linting
https://github.com/koalaman/shellcheck/wiki

start.sh:
Fix SC2173 on line 14.

letsencrypt_service:
Ignore SC2120 and SC1090.
Fix SC1087 on line 54, SC2068 on lines 54 and 124.
Fix SC2034 on lines 12, 13, 19 and 20.
+ use pushd / popd to change the CWD back to /etc/nginx/certs after simp_le execution.

functions.sh:
Ignore SC2155.
Add the missing shebang.

entrypoint.sh:
Ignore SC2155.
2017-11-22 18:27:39 +01:00

29 lines
711 B
Bash
Executable File

#!/bin/bash
# SIGTERM-handler
term_handler() {
[[ -n "$docker_gen_pid" ]] && kill $docker_gen_pid
[[ -n "$letsencrypt_service_pid" ]] && kill $letsencrypt_service_pid
source /app/functions.sh
remove_all_location_configurations
exit 143; # 128 + 15 -- SIGTERM
}
trap 'term_handler' INT QUIT TERM
/app/letsencrypt_service &
letsencrypt_service_pid=$!
docker-gen -watch -notify '/app/update_certs' -wait 15s:60s /app/letsencrypt_service_data.tmpl /app/letsencrypt_service_data &
docker_gen_pid=$!
# wait "indefinitely"
while [[ -e /proc/$docker_gen_pid ]]; do
wait $docker_gen_pid # Wait for any signals or end of execution of docker-gen
done
# Stop container properly
term_handler