From 1440b87d74b9f2b5003bad03d5a3a731c4d24d9d Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 2 Sep 2022 16:42:53 -0400 Subject: [PATCH] Update run --- root/etc/services.d/extended_recyclarr/run | 36 ++-------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/root/etc/services.d/extended_recyclarr/run b/root/etc/services.d/extended_recyclarr/run index 19c8ddd..cbe1aea 100644 --- a/root/etc/services.d/extended_recyclarr/run +++ b/root/etc/services.d/extended_recyclarr/run @@ -1,16 +1,4 @@ #!/usr/bin/with-contenv bash -echo "-----------------------------------------------------------------------------" -echo " |~) _ ._ _| _ ._ _ |\ |o._ o _ |~|_|_|" -echo " |~\(_|| |(_|(_)| | || \||| |_|(_||~| | |<" -echo " Presents: radarr-extended" -echo " Docker Version: $dockerVersion" -echo " May the vidz be with you!" -echo "-----------------------------------------------------------------------------" -echo "Donate: https://github.com/sponsors/RandomNinjaAtk" -echo "Project: https://github.com/RandomNinjaAtk/docker-radarr-extended" -echo "Support: https://github.com/RandomNinjaAtk/docker-radarr-extended/discussions" -echo "-----------------------------------------------------------------------------" - if [ "$enableRecyclarr" != "true" ]; then echo "Recyclarr disabled, enable by setting parameter: enableRecyclarr=true" sleep infinity @@ -22,27 +10,9 @@ fi echo "Starting Script...." for (( ; ; )); do let i++ - if [ ! -d "/config/logs" ]; then - mkdir -p "/config/logs" - chmod 777 "/config/logs" - chown abc:abc "/config/logs" - fi - if [ -f "/config/extended/logs/log-cleanup" ]; then - rm "/config/extended/logs/log-cleanup" - fi - touch -d "24 hours ago" "/config/extended/logs/log-cleanup" - if find "/config/logs" -type f -iname "extended_recyclarr_*.txt" -not -newer "/config/extended/logs/log-cleanup" | read; then - find "/config/logs" -type f -iname "extended_recyclarr_*.txt" -not -newer "/config/extended/logs/log-cleanup" -delete - fi - if [ -f "/config/extended/logs/log-cleanup" ]; then - rm "/config/extended/logs/log-cleanup" - fi - bash /config/extended/scripts/recyclarr.sh 2>&1 | tee "/config/logs/extended_recyclarr_${i}_$(date +"%Y_%m_%d_%I_%M_%p").txt" > /proc/1/fd/1 2>/proc/1/fd/2 - if [ -z "$scriptInterval" ]; then - scriptInterval="4h" - fi - echo "Script sleeping for $scriptInterval..." - sleep $scriptInterval + bash /config/extended/scripts/Recyclarr.bash + echo "Script sleeping for 4 hours..." + sleep 4h done