1
0

Minor edits for coding style consistency

This commit is contained in:
Nicolas Duchon 2018-02-08 23:57:50 +01:00
parent 4b2b4429a4
commit 3b212f2bf3
No known key found for this signature in database
GPG Key ID: 91EF7BB1EECB961A
3 changed files with 14 additions and 17 deletions

@ -4,8 +4,8 @@
set -u
if [[ -n "${ACME_TOS_HASH:-}" ]]; then
echo -n "The ACME_TOS_HASH environment variable is no longer used by simp_le "
echo "and has been deprecated. simp_le now implicitly agree to the ACME CA ToS."
echo "Info: the ACME_TOS_HASH environment variable is no longer used by simp_le and has been deprecated."
echo "simp_le now implicitly agree to the ACME CA ToS."
fi
DOCKER_PROVIDER=${DOCKER_PROVIDER:-docker}
@ -34,11 +34,8 @@ function check_docker_socket {
if [[ $DOCKER_HOST == unix://* ]]; then
socket_file=${DOCKER_HOST#unix://}
if [[ ! -S $socket_file ]]; then
cat >&2 <<-EOT
ERROR: you need to share your Docker host socket with a volume at $socket_file
Typically you should run your container with: \`-v /var/run/docker.sock:$socket_file:ro\`
See the documentation at http://git.io/vZaGJ
EOT
echo "Error: you need to share your Docker host socket with a volume at $socket_file" >&2
echo "Typically you should run your container with: '-v /var/run/docker.sock:$socket_file:ro'" >&2
exit 1
fi
fi

@ -27,7 +27,7 @@ function check_two_containers_case() {
return 0
}
add_location_configuration() {
function add_location_configuration {
local domain="${1:-}"
[[ -z "$domain" || ! -f "${VHOST_DIR}/${domain}" ]] && domain=default
[[ -f "${VHOST_DIR}/${domain}" && \
@ -40,7 +40,7 @@ add_location_configuration() {
return 1
}
remove_all_location_configurations() {
function remove_all_location_configurations {
local old_shopt_options=$(shopt -p) # Backup shopt options
shopt -s nullglob
for file in "${VHOST_DIR}"/*; do
@ -105,7 +105,7 @@ function get_nginx_proxy_container {
}
## Nginx
reload_nginx() {
function reload_nginx {
local _docker_gen_container=$(get_docker_gen_container)
local _nginx_proxy_container=$(get_nginx_proxy_container)
@ -130,6 +130,6 @@ reload_nginx() {
}
# Convert argument to lowercase (bash 4 only)
function lc() {
function lc {
echo "${@,,}"
}

@ -11,14 +11,14 @@ DEFAULT_KEY_SIZE=4096
REUSE_ACCOUNT_KEYS="$(lc ${REUSE_ACCOUNT_KEYS:-true})"
REUSE_PRIVATE_KEYS="$(lc ${REUSE_PRIVATE_KEYS:-false})"
create_link() {
function create_link {
local -r target=${1?missing target argument}
local -r source=${2?missing source argument}
[[ -f "$target" ]] && return 1
ln -sf "$source" "$target"
}
create_links() {
function create_links {
local -r base_domain=${1?missing base_domain argument}
local -r domain=${2?missing base_domain argument}
@ -99,11 +99,11 @@ function cleanup_links {
fi
}
update_certs() {
function update_certs {
check_two_containers_case && (check_nginx_proxy_container_run || return)
[[ ! -f "$DIR"/letsencrypt_service_data ]] && return
[[ -f "$DIR"/letsencrypt_service_data ]] || return
# Load relevant container settings
unset LETSENCRYPT_CONTAINERS
@ -178,7 +178,7 @@ update_certs() {
# Create directory for the first domain
mkdir -p /etc/nginx/certs/$base_domain
pushd /etc/nginx/certs/$base_domain
pushd /etc/nginx/certs/$base_domain || return
for domain in "${!hosts_array}"; do
# Add all the domains to certificate
@ -223,7 +223,7 @@ update_certs() {
fi
fi
popd
popd || return
for altnames in "${hosts_array_expanded[@]:1}"; do
# Remove old CN domain that now are altnames