From c00af704795b18cefa6dee75720473c3e446b9e2 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Sat, 18 Mar 2023 12:15:19 -0400 Subject: [PATCH] Update run --- root/etc/services.d/extended_queuecleaner/run | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/root/etc/services.d/extended_queuecleaner/run b/root/etc/services.d/extended_queuecleaner/run index 62a45bc..138255b 100644 --- a/root/etc/services.d/extended_queuecleaner/run +++ b/root/etc/services.d/extended_queuecleaner/run @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.1" +scriptVersion="1.0.2" ######## Settings scriptInterval="15m" @@ -85,14 +85,16 @@ QueueCleanerProcess () { verifyApiAccess () { until false do - arrApiTest="" - if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then - arrApiTest=$(curl -s "$arrUrl/api/v3/system/status?apikey=$arrApiKey" | jq -r .instanceName) - elif [ "$arrName" == "Lidarr" ]; then - arrApiTest=$(curl -s "$arrUrl/api/v1/system/status?apikey=$arrApiKey" | jq -r .instanceName) - fi + arrApiTest="" + arrApiVersion="" + if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then + arrApiVersion="v3" + elif [ "$arrName" == "Lidarr" ]; then + arrApiVersion="v1" + fi + arrApiTest=$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName) if [ "$arrApiTest" == "$arrName" ]; then - arrVersion=$(curl -s "$arrUrl/api/v3/system/status?apikey=$arrApiKey" | jq -r .version) + arrVersion=$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .version) log "$arrName Version: $arrVersion" break else