aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Segundo2023-12-31 13:10:41 +0100
committerChristian Segundo2023-12-31 13:10:41 +0100
commitcf637bd6b4fca2f7e867a05d139d3664cba2ba26 (patch)
tree20e885f23d31c745b2b0dcb268b188ad8cf5a017
parentbc58e4d33a356b2e7c8dbeec95cec8a5ffadde47 (diff)
downloadtransmission-hacks-cf637bd6b4fca2f7e867a05d139d3664cba2ba26.tar.gz
shfmt
-rw-r--r--scripts/cron.sh4
-rw-r--r--scripts/entrypoint.sh32
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 <<EOF >> /etc/cron.d/crontab
+cat <<EOF >>/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 <<EOF >> /etc/cron.d/crontab
+ key="DELETE_TAG_${i}_NAME"
+ val="DELETE_TAG_${i}_AGE"
+ if [ -z "${!key:-}" ]; then
+ break
+ fi
+ cat <<EOF >>/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 <<EOF >> /etc/cron.d/crontab
+ key="DELETE_UNLINKED_${i}_NAME"
+ val="DELETE_UNLINKED_${i}_AGE"
+ if [ -z "${!key:-}" ]; then
+ break
+ fi
+ cat <<EOF >>/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}"