From 4b1e602d9b56da2afe2d2a255ce4fa736dc67fcb Mon Sep 17 00:00:00 2001 From: aptalca Date: Mon, 3 May 2021 14:27:50 -0400 Subject: [PATCH] update cron times, clean up scripts --- Dockerfile | 6 +++--- Dockerfile.aarch64 | 6 +++--- Dockerfile.armhf | 6 +++--- root/app/duck.sh | 8 ++++---- root/defaults/duckcron | 2 +- root/etc/cont-init.d/40-config | 2 +- root/etc/crontabs/abc | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index b0d309f..a1b5e07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,9 @@ LABEL maintainer="aptalca" ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ - echo "**** install packages ****" && \ - apk add --no-cache \ - curl + echo "**** install packages ****" && \ + apk add --no-cache \ + curl # add local files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 4bd310b..a2021ad 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -11,9 +11,9 @@ LABEL maintainer="aptalca" ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ - echo "**** install packages ****" && \ - apk add --no-cache \ - curl + echo "**** install packages ****" && \ + apk add --no-cache \ + curl # add local files COPY root/ / diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 363a5de..99caea1 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -11,9 +11,9 @@ LABEL maintainer="aptalca" ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ - echo "**** install packages ****" && \ - apk add --no-cache \ - curl + echo "**** install packages ****" && \ + apk add --no-cache \ + curl # add local files COPY root/ / diff --git a/root/app/duck.sh b/root/app/duck.sh index 7c309d8..3845b1f 100755 --- a/root/app/duck.sh +++ b/root/app/duck.sh @@ -1,9 +1,9 @@ #!/usr/bin/with-contenv bash . /app/duck.conf -RESPONSE=`curl -s "https://www.duckdns.org/update?domains=$SUBDOMAINS&token=$TOKEN&ip="` -if [ "$RESPONSE" = "OK" ]; then -echo "Your IP was updated at "$(date) +RESPONSE=$(curl -sSk "https://www.duckdns.org/update?domains=${SUBDOMAINS}&token=${TOKEN}&ip=") +if [ "${RESPONSE}" = "OK" ]; then + echo "Your IP was updated at $(date)" else -echo "Something went wrong, please check your settings "$(date) + echo -e "Something went wrong, please check your settings $(date)\nThe response returned was:\n${RESPONSE}" fi diff --git a/root/defaults/duckcron b/root/defaults/duckcron index a20a1fb..3fe453f 100644 --- a/root/defaults/duckcron +++ b/root/defaults/duckcron @@ -1 +1 @@ -*/5 * * * * /app/duck.sh 2>&1 > /config/duck.log +2,7,12,17,22,27,32,37,42,47,52,57 * * * * /app/duck.sh 2>&1 > /config/duck.log diff --git a/root/etc/cont-init.d/40-config b/root/etc/cont-init.d/40-config index 2abadbe..76e28a0 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -6,7 +6,7 @@ if [ -z "$SUBDOMAINS" ] || [ -z "$TOKEN" ]; then exit 1 else echo "Retrieving subdomain and token from the environment variables" - echo -e "SUBDOMAINS=$SUBDOMAINS TOKEN=$TOKEN" > /app/duck.conf + echo -e "SUBDOMAINS=\"${SUBDOMAINS}\" TOKEN=\"${TOKEN}\"" > /app/duck.conf fi # modify crontab if logging to file diff --git a/root/etc/crontabs/abc b/root/etc/crontabs/abc index 287f31c..662d98e 100644 --- a/root/etc/crontabs/abc +++ b/root/etc/crontabs/abc @@ -1 +1 @@ -*/5 * * * * /app/duck.sh 2>&1 +2,7,12,17,22,27,32,37,42,47,52,57 * * * * /app/duck.sh 2>&1