From 2c750147ad55224da048dc3b725575a9d2dc06ef Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Thu, 6 Jul 2023 18:16:22 -0400 Subject: [PATCH] v1.0.4 - Only install packages if script hasn't previously been run.. If a log file exists for the script, skip the package installation procedure. --- QueueCleaner.bash | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/QueueCleaner.bash b/QueueCleaner.bash index 8f8aa48..3483308 100644 --- a/QueueCleaner.bash +++ b/QueueCleaner.bash @@ -1,13 +1,17 @@ #!/usr/bin/with-contenv bash -scriptVersion="1.0.3" +scriptVersion="1.0.4" ######## Settings scriptInterval="15m" ######## Package dependencies installation PackageInstallation () { - apk add -U --update --no-cache curl jq python3-dev py3-pip &>/dev/null - pip install --upgrade --no-cache-dir -U yq &>/dev/null + if [ ! -f "/config/logs/QueueCleaner.txt" ]; then + echo "Installing Required Packages..." + apk add -U --update --no-cache curl jq python3-dev py3-pip &>/dev/null + pip install --upgrade --no-cache-dir -U yq &>/dev/null + echo "Done" + fi } # Logging output function @@ -121,7 +125,7 @@ arrName="$(cat /config/config.xml | xq | jq -r .Config.InstanceName)" if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ] || [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then for (( ; ; )); do let i++ - log "Starting..." + log "Starting..." QueueCleanerProcess log "Sleeping $scriptInterval..." sleep $scriptInterval