From cf637bd6b4fca2f7e867a05d139d3664cba2ba26 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 31 Dec 2023 13:10:41 +0100 Subject: shfmt --- scripts/cron.sh | 4 ++-- scripts/entrypoint.sh | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/cron.sh b/scripts/cron.sh index 3bd483e..1ce9e65 100644 --- a/scripts/cron.sh +++ b/scripts/cron.sh @@ -10,7 +10,7 @@ while true; do break fi tag_age["${!key}"]="${!val}" - i=$((i+1)) + i=$((i + 1)) done declare -A unlinked_tag_age @@ -22,7 +22,7 @@ while true; do break fi unlinked_tag_age["${!key}"]="${!val}" - i=$((i+1)) + i=$((i + 1)) done timeout "${SCRIPT_TIMEOUT}" "${PYTHON_PATH}" "${SCRIPT_PREFIX}"/tag-based-on-dir.py \ diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index c61a0ff..93c248d 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail -cat <> /etc/cron.d/crontab +cat <>/etc/cron.d/crontab PYTHON_PATH=/usr/local/bin/python3 SCRIPT_PREFIX=/scripts SCRIPT_TIMEOUT=${SCRIPT_TIMEOUT:-300} @@ -11,33 +11,33 @@ EOF i=0 while true; do - key="DELETE_TAG_${i}_NAME" - val="DELETE_TAG_${i}_AGE" - if [ -z "${!key:-}" ]; then - break - fi - cat <> /etc/cron.d/crontab + key="DELETE_TAG_${i}_NAME" + val="DELETE_TAG_${i}_AGE" + if [ -z "${!key:-}" ]; then + break + fi + cat <>/etc/cron.d/crontab DELETE_TAG_${i}=${!key} DELETE_AGE_${i}=${!val} EOF - i=$((i+1)) + i=$((i + 1)) done i=0 while true; do - key="DELETE_UNLINKED_${i}_NAME" - val="DELETE_UNLINKED_${i}_AGE" - if [ -z "${!key:-}" ]; then - break - fi - cat <> /etc/cron.d/crontab + key="DELETE_UNLINKED_${i}_NAME" + val="DELETE_UNLINKED_${i}_AGE" + if [ -z "${!key:-}" ]; then + break + fi + cat <>/etc/cron.d/crontab DELETE_UNLINKED_TAG_${i}=${!key} DELETE_UNLINKED_AGE_${i}=${!val} EOF - i=$((i+1)) + i=$((i + 1)) done -echo "${CRON_EXPRESSION:-* * * * *} /bin/bash /scripts/cron.sh >/proc/1/fd/1 2>/proc/1/fd/2" >> /etc/cron.d/crontab +echo "${CRON_EXPRESSION:-* * * * *} /bin/bash /scripts/cron.sh >/proc/1/fd/1 2>/proc/1/fd/2" >>/etc/cron.d/crontab cat /etc/cron.d/crontab crontab /etc/cron.d/crontab cron -f -l "${CRON_LOG_LEVEL:-0}" -- cgit v1.2.3