From 31197335909b5cbf64a8b6f4edbb8d20c2b1540d Mon Sep 17 00:00:00 2001 From: Aleksejs Spiridonovs Date: Mon, 22 Feb 2021 22:49:03 +0200 Subject: [PATCH 1/5] FEAT: entrypoint script background-reloading Nginx (think LetsEncrypt certs) --- Dockerfile-alpine.template | 1 + Dockerfile-debian.template | 1 + entrypoint/40-reload-every-x-hours.sh | 14 ++++++++++++++ mainline/alpine-perl/40-reload-every-x-hours.sh | 14 ++++++++++++++ mainline/alpine-perl/Dockerfile | 1 + mainline/alpine/40-reload-every-x-hours.sh | 14 ++++++++++++++ mainline/alpine/Dockerfile | 1 + mainline/debian-perl/40-reload-every-x-hours.sh | 14 ++++++++++++++ mainline/debian-perl/Dockerfile | 1 + mainline/debian/40-reload-every-x-hours.sh | 14 ++++++++++++++ mainline/debian/Dockerfile | 1 + stable/alpine-perl/40-reload-every-x-hours.sh | 14 ++++++++++++++ stable/alpine-perl/Dockerfile | 1 + stable/alpine/40-reload-every-x-hours.sh | 14 ++++++++++++++ stable/alpine/Dockerfile | 1 + stable/debian-perl/40-reload-every-x-hours.sh | 14 ++++++++++++++ stable/debian-perl/Dockerfile | 1 + stable/debian/40-reload-every-x-hours.sh | 14 ++++++++++++++ stable/debian/Dockerfile | 1 + 19 files changed, 136 insertions(+) create mode 100644 entrypoint/40-reload-every-x-hours.sh create mode 100644 mainline/alpine-perl/40-reload-every-x-hours.sh create mode 100644 mainline/alpine/40-reload-every-x-hours.sh create mode 100644 mainline/debian-perl/40-reload-every-x-hours.sh create mode 100644 mainline/debian/40-reload-every-x-hours.sh create mode 100644 stable/alpine-perl/40-reload-every-x-hours.sh create mode 100644 stable/alpine/40-reload-every-x-hours.sh create mode 100644 stable/debian-perl/40-reload-every-x-hours.sh create mode 100644 stable/debian/40-reload-every-x-hours.sh diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 1ce4411a..5ca70407 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -106,6 +106,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 91b7cf78..11123fd7 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -97,6 +97,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/entrypoint/40-reload-every-x-hours.sh b/entrypoint/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/entrypoint/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/mainline/alpine-perl/40-reload-every-x-hours.sh b/mainline/alpine-perl/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/mainline/alpine-perl/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/mainline/alpine-perl/Dockerfile b/mainline/alpine-perl/Dockerfile index 851b86d6..643c0e59 100644 --- a/mainline/alpine-perl/Dockerfile +++ b/mainline/alpine-perl/Dockerfile @@ -117,6 +117,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/mainline/alpine/40-reload-every-x-hours.sh b/mainline/alpine/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/mainline/alpine/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/mainline/alpine/Dockerfile b/mainline/alpine/Dockerfile index 59519217..f11d0c90 100644 --- a/mainline/alpine/Dockerfile +++ b/mainline/alpine/Dockerfile @@ -116,6 +116,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/mainline/debian-perl/40-reload-every-x-hours.sh b/mainline/debian-perl/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/mainline/debian-perl/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/mainline/debian-perl/Dockerfile b/mainline/debian-perl/Dockerfile index 0874f07d..4876478b 100644 --- a/mainline/debian-perl/Dockerfile +++ b/mainline/debian-perl/Dockerfile @@ -108,6 +108,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/mainline/debian/40-reload-every-x-hours.sh b/mainline/debian/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/mainline/debian/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/mainline/debian/Dockerfile b/mainline/debian/Dockerfile index 198e225c..faca8058 100644 --- a/mainline/debian/Dockerfile +++ b/mainline/debian/Dockerfile @@ -107,6 +107,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/stable/alpine-perl/40-reload-every-x-hours.sh b/stable/alpine-perl/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/stable/alpine-perl/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/stable/alpine-perl/Dockerfile b/stable/alpine-perl/Dockerfile index 6df7dde2..10d8ffb4 100644 --- a/stable/alpine-perl/Dockerfile +++ b/stable/alpine-perl/Dockerfile @@ -117,6 +117,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/stable/alpine/40-reload-every-x-hours.sh b/stable/alpine/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/stable/alpine/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/stable/alpine/Dockerfile b/stable/alpine/Dockerfile index 397380ad..0e29e84e 100644 --- a/stable/alpine/Dockerfile +++ b/stable/alpine/Dockerfile @@ -116,6 +116,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/stable/debian-perl/40-reload-every-x-hours.sh b/stable/debian-perl/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/stable/debian-perl/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/stable/debian-perl/Dockerfile b/stable/debian-perl/Dockerfile index 90a797dc..beabb704 100644 --- a/stable/debian-perl/Dockerfile +++ b/stable/debian-perl/Dockerfile @@ -108,6 +108,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/stable/debian/40-reload-every-x-hours.sh b/stable/debian/40-reload-every-x-hours.sh new file mode 100644 index 00000000..850ceb5a --- /dev/null +++ b/stable/debian/40-reload-every-x-hours.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +ME=$(basename $0) + +[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 + +start_background_reload() { + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & +} + +start_background_reload \ No newline at end of file diff --git a/stable/debian/Dockerfile b/stable/debian/Dockerfile index a4d932bf..c92dead9 100644 --- a/stable/debian/Dockerfile +++ b/stable/debian/Dockerfile @@ -107,6 +107,7 @@ COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d +COPY 40-reload-every-x-hours.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 From 451f81970045e40866500887ed79b3849b38e2da Mon Sep 17 00:00:00 2001 From: Aleksejs Spiridonovs Date: Mon, 22 Feb 2021 23:04:26 +0200 Subject: [PATCH 2/5] UX: output during reload; FIX: chmod +x --- entrypoint/40-reload-every-x-hours.sh | 2 +- mainline/alpine-perl/40-reload-every-x-hours.sh | 2 +- mainline/alpine/40-reload-every-x-hours.sh | 2 +- mainline/debian-perl/40-reload-every-x-hours.sh | 2 +- mainline/debian/40-reload-every-x-hours.sh | 2 +- stable/alpine-perl/40-reload-every-x-hours.sh | 2 +- stable/alpine/40-reload-every-x-hours.sh | 2 +- stable/debian-perl/40-reload-every-x-hours.sh | 2 +- stable/debian/40-reload-every-x-hours.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 entrypoint/40-reload-every-x-hours.sh mode change 100644 => 100755 mainline/alpine-perl/40-reload-every-x-hours.sh mode change 100644 => 100755 mainline/alpine/40-reload-every-x-hours.sh mode change 100644 => 100755 mainline/debian-perl/40-reload-every-x-hours.sh mode change 100644 => 100755 mainline/debian/40-reload-every-x-hours.sh mode change 100644 => 100755 stable/alpine-perl/40-reload-every-x-hours.sh mode change 100644 => 100755 stable/alpine/40-reload-every-x-hours.sh mode change 100644 => 100755 stable/debian-perl/40-reload-every-x-hours.sh mode change 100644 => 100755 stable/debian/40-reload-every-x-hours.sh diff --git a/entrypoint/40-reload-every-x-hours.sh b/entrypoint/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/entrypoint/40-reload-every-x-hours.sh +++ b/entrypoint/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/mainline/alpine-perl/40-reload-every-x-hours.sh b/mainline/alpine-perl/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/mainline/alpine-perl/40-reload-every-x-hours.sh +++ b/mainline/alpine-perl/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/mainline/alpine/40-reload-every-x-hours.sh b/mainline/alpine/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/mainline/alpine/40-reload-every-x-hours.sh +++ b/mainline/alpine/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/mainline/debian-perl/40-reload-every-x-hours.sh b/mainline/debian-perl/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/mainline/debian-perl/40-reload-every-x-hours.sh +++ b/mainline/debian-perl/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/mainline/debian/40-reload-every-x-hours.sh b/mainline/debian/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/mainline/debian/40-reload-every-x-hours.sh +++ b/mainline/debian/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/stable/alpine-perl/40-reload-every-x-hours.sh b/stable/alpine-perl/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/stable/alpine-perl/40-reload-every-x-hours.sh +++ b/stable/alpine-perl/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/stable/alpine/40-reload-every-x-hours.sh b/stable/alpine/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/stable/alpine/40-reload-every-x-hours.sh +++ b/stable/alpine/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/stable/debian-perl/40-reload-every-x-hours.sh b/stable/debian-perl/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/stable/debian-perl/40-reload-every-x-hours.sh +++ b/stable/debian-perl/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file diff --git a/stable/debian/40-reload-every-x-hours.sh b/stable/debian/40-reload-every-x-hours.sh old mode 100644 new mode 100755 index 850ceb5a..41621e4f --- a/stable/debian/40-reload-every-x-hours.sh +++ b/stable/debian/40-reload-every-x-hours.sh @@ -8,7 +8,7 @@ ME=$(basename $0) start_background_reload() { echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; nginx -s reload; done & + while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload \ No newline at end of file From 37fa99370fd90718c03563ba62c05eea7f6e366a Mon Sep 17 00:00:00 2001 From: Aleksejs Spiridonovs Date: Tue, 23 Feb 2021 00:20:29 +0200 Subject: [PATCH 3/5] FEAT: validate provided value --- entrypoint/40-reload-every-x-hours.sh | 6 +++++- mainline/alpine-perl/40-reload-every-x-hours.sh | 6 +++++- mainline/alpine/40-reload-every-x-hours.sh | 6 +++++- mainline/debian-perl/40-reload-every-x-hours.sh | 6 +++++- mainline/debian/40-reload-every-x-hours.sh | 6 +++++- stable/alpine-perl/40-reload-every-x-hours.sh | 6 +++++- stable/alpine/40-reload-every-x-hours.sh | 6 +++++- stable/debian-perl/40-reload-every-x-hours.sh | 6 +++++- stable/debian/40-reload-every-x-hours.sh | 6 +++++- 9 files changed, 45 insertions(+), 9 deletions(-) diff --git a/entrypoint/40-reload-every-x-hours.sh b/entrypoint/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/entrypoint/40-reload-every-x-hours.sh +++ b/entrypoint/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/mainline/alpine-perl/40-reload-every-x-hours.sh b/mainline/alpine-perl/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/mainline/alpine-perl/40-reload-every-x-hours.sh +++ b/mainline/alpine-perl/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/mainline/alpine/40-reload-every-x-hours.sh b/mainline/alpine/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/mainline/alpine/40-reload-every-x-hours.sh +++ b/mainline/alpine/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/mainline/debian-perl/40-reload-every-x-hours.sh b/mainline/debian-perl/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/mainline/debian-perl/40-reload-every-x-hours.sh +++ b/mainline/debian-perl/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/mainline/debian/40-reload-every-x-hours.sh b/mainline/debian/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/mainline/debian/40-reload-every-x-hours.sh +++ b/mainline/debian/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/stable/alpine-perl/40-reload-every-x-hours.sh b/stable/alpine-perl/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/stable/alpine-perl/40-reload-every-x-hours.sh +++ b/stable/alpine-perl/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/stable/alpine/40-reload-every-x-hours.sh b/stable/alpine/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/stable/alpine/40-reload-every-x-hours.sh +++ b/stable/alpine/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/stable/debian-perl/40-reload-every-x-hours.sh b/stable/debian-perl/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/stable/debian-perl/40-reload-every-x-hours.sh +++ b/stable/debian-perl/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } diff --git a/stable/debian/40-reload-every-x-hours.sh b/stable/debian/40-reload-every-x-hours.sh index 41621e4f..cb4e8d57 100755 --- a/stable/debian/40-reload-every-x-hours.sh +++ b/stable/debian/40-reload-every-x-hours.sh @@ -5,9 +5,13 @@ set -e ME=$(basename $0) [ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then + echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." + exit 1 +fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hours" + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } From 3fb5e237e1ef521ef1dbc3b15c1a0f71592acb69 Mon Sep 17 00:00:00 2001 From: Aleksejs Spiridonovs Date: Tue, 23 Feb 2021 00:23:32 +0200 Subject: [PATCH 4/5] CHORE: EOF newlines to be nice --- entrypoint/40-reload-every-x-hours.sh | 2 +- mainline/alpine-perl/40-reload-every-x-hours.sh | 2 +- mainline/alpine/40-reload-every-x-hours.sh | 2 +- mainline/debian-perl/40-reload-every-x-hours.sh | 2 +- mainline/debian/40-reload-every-x-hours.sh | 2 +- stable/alpine-perl/40-reload-every-x-hours.sh | 2 +- stable/alpine/40-reload-every-x-hours.sh | 2 +- stable/debian-perl/40-reload-every-x-hours.sh | 2 +- stable/debian/40-reload-every-x-hours.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/entrypoint/40-reload-every-x-hours.sh b/entrypoint/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/entrypoint/40-reload-every-x-hours.sh +++ b/entrypoint/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/mainline/alpine-perl/40-reload-every-x-hours.sh b/mainline/alpine-perl/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/mainline/alpine-perl/40-reload-every-x-hours.sh +++ b/mainline/alpine-perl/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/mainline/alpine/40-reload-every-x-hours.sh b/mainline/alpine/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/mainline/alpine/40-reload-every-x-hours.sh +++ b/mainline/alpine/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/mainline/debian-perl/40-reload-every-x-hours.sh b/mainline/debian-perl/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/mainline/debian-perl/40-reload-every-x-hours.sh +++ b/mainline/debian-perl/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/mainline/debian/40-reload-every-x-hours.sh b/mainline/debian/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/mainline/debian/40-reload-every-x-hours.sh +++ b/mainline/debian/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/stable/alpine-perl/40-reload-every-x-hours.sh b/stable/alpine-perl/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/stable/alpine-perl/40-reload-every-x-hours.sh +++ b/stable/alpine-perl/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/stable/alpine/40-reload-every-x-hours.sh b/stable/alpine/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/stable/alpine/40-reload-every-x-hours.sh +++ b/stable/alpine/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/stable/debian-perl/40-reload-every-x-hours.sh b/stable/debian-perl/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/stable/debian-perl/40-reload-every-x-hours.sh +++ b/stable/debian-perl/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload diff --git a/stable/debian/40-reload-every-x-hours.sh b/stable/debian/40-reload-every-x-hours.sh index cb4e8d57..ac86196b 100755 --- a/stable/debian/40-reload-every-x-hours.sh +++ b/stable/debian/40-reload-every-x-hours.sh @@ -15,4 +15,4 @@ start_background_reload() { while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } -start_background_reload \ No newline at end of file +start_background_reload From 0e9b58ed33df8c3eb84faf7f0f58862087d2d299 Mon Sep 17 00:00:00 2001 From: Aleksejs Spiridonovs Date: Tue, 23 Feb 2021 00:44:36 +0200 Subject: [PATCH 5/5] CHORE: concise VAR name, no tautology --- entrypoint/40-reload-every-x-hours.sh | 8 ++++---- mainline/alpine-perl/40-reload-every-x-hours.sh | 8 ++++---- mainline/alpine/40-reload-every-x-hours.sh | 8 ++++---- mainline/debian-perl/40-reload-every-x-hours.sh | 8 ++++---- mainline/debian/40-reload-every-x-hours.sh | 8 ++++---- stable/alpine-perl/40-reload-every-x-hours.sh | 8 ++++---- stable/alpine/40-reload-every-x-hours.sh | 8 ++++---- stable/debian-perl/40-reload-every-x-hours.sh | 8 ++++---- stable/debian/40-reload-every-x-hours.sh | 8 ++++---- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/entrypoint/40-reload-every-x-hours.sh b/entrypoint/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/entrypoint/40-reload-every-x-hours.sh +++ b/entrypoint/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/mainline/alpine-perl/40-reload-every-x-hours.sh b/mainline/alpine-perl/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/mainline/alpine-perl/40-reload-every-x-hours.sh +++ b/mainline/alpine-perl/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/mainline/alpine/40-reload-every-x-hours.sh b/mainline/alpine/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/mainline/alpine/40-reload-every-x-hours.sh +++ b/mainline/alpine/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/mainline/debian-perl/40-reload-every-x-hours.sh b/mainline/debian-perl/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/mainline/debian-perl/40-reload-every-x-hours.sh +++ b/mainline/debian-perl/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/mainline/debian/40-reload-every-x-hours.sh b/mainline/debian/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/mainline/debian/40-reload-every-x-hours.sh +++ b/mainline/debian/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/stable/alpine-perl/40-reload-every-x-hours.sh b/stable/alpine-perl/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/stable/alpine-perl/40-reload-every-x-hours.sh +++ b/stable/alpine-perl/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/stable/alpine/40-reload-every-x-hours.sh b/stable/alpine/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/stable/alpine/40-reload-every-x-hours.sh +++ b/stable/alpine/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/stable/debian-perl/40-reload-every-x-hours.sh b/stable/debian-perl/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/stable/debian-perl/40-reload-every-x-hours.sh +++ b/stable/debian-perl/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload diff --git a/stable/debian/40-reload-every-x-hours.sh b/stable/debian/40-reload-every-x-hours.sh index ac86196b..81bf3503 100755 --- a/stable/debian/40-reload-every-x-hours.sh +++ b/stable/debian/40-reload-every-x-hours.sh @@ -4,15 +4,15 @@ set -e ME=$(basename $0) -[ "${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 -if [ $(echo "$NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then +[ "${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS:-}" ] || exit 0 +if [ $(echo "$NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS > 0" | bc) == 0 ]; then echo >&3 "$ME: Error. Provide integer or floating point number greater that 0. See 'man sleep'." exit 1 fi start_background_reload() { - echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS hour(s)" - while :; do sleep ${NGINX_ENTRYPOINT_NGINX_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & + echo >&3 "$ME: Reloading Nginx every $NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS hour(s)" + while :; do sleep ${NGINX_ENTRYPOINT_RELOAD_EVERY_X_HOURS}h; echo >&3 "$ME: Reloading Nginx ..." && nginx -s reload; done & } start_background_reload