pull/226/head
RandomNinjaAtk 2 years ago committed by GitHub
parent c418597774
commit c00af70479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.1"
scriptVersion="1.0.2"
######## Settings
scriptInterval="15m"
@ -86,13 +86,15 @@ verifyApiAccess () {
until false
do
arrApiTest=""
arrApiVersion=""
if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then
arrApiTest=$(curl -s "$arrUrl/api/v3/system/status?apikey=$arrApiKey" | jq -r .instanceName)
arrApiVersion="v3"
elif [ "$arrName" == "Lidarr" ]; then
arrApiTest=$(curl -s "$arrUrl/api/v1/system/status?apikey=$arrApiKey" | jq -r .instanceName)
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

Loading…
Cancel
Save