From 2c93170ab29de83709348fe58d0dbf54db311ba7 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 14 Jul 2023 19:08:32 -0400 Subject: [PATCH] v1.3 - Use port instead of App Name #17 #2 --- universal/services/QueueCleaner | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/universal/services/QueueCleaner b/universal/services/QueueCleaner index ec54e2e..4a15188 100644 --- a/universal/services/QueueCleaner +++ b/universal/services/QueueCleaner @@ -1,5 +1,5 @@ #!/usr/bin/with-contenv bash -scriptVersion="1.2" +scriptVersion="1.3" scriptName="QueueCleaner" log () { @@ -103,9 +103,9 @@ verifyApiAccess () { do arrApiTest="" arrApiVersion="" - if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then + if [ "$arrName" == "8989" ] || [ "$arrPort" == "7878" ]; then arrApiVersion="v3" - elif [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then + elif [ "$arrPort" == "8686" ] || [ "$arrPort" == "8787" ]; then arrApiVersion="v1" fi arrApiTest=$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName) @@ -118,19 +118,14 @@ verifyApiAccess () { done } -arrName="$(cat /config/config.xml | xq | jq -r .Config.InstanceName)" -if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ] || [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then - for (( ; ; )); do - let i++ - logfileSetup - verifyConfig - log "Starting..." - QueueCleanerProcess - log "Sleeping 15m..." - sleep 15m - done -else - log "ERROR :: Arr app not detected, exiting..." -fi +for (( ; ; )); do + let i++ + logfileSetup + verifyConfig + log "Starting..." + QueueCleanerProcess + log "Sleeping 15m..." + sleep 15m +done exit