space fixes

This commit is contained in:
RandomNinjaAtk 2023-07-06 19:02:06 -04:00 committed by GitHub
parent 2c750147ad
commit 89aee4bb5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
scriptVersion="1.0.4" scriptVersion="1.0.5"
######## Settings ######## Settings
scriptInterval="15m" scriptInterval="15m"
@ -99,23 +99,23 @@ QueueCleanerProcess () {
} }
verifyApiAccess () { verifyApiAccess () {
until false until false
do do
arrApiTest="" arrApiTest=""
arrApiVersion="" arrApiVersion=""
if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then
arrApiVersion="v3" arrApiVersion="v3"
elif [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then elif [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then
arrApiVersion="v1" arrApiVersion="v1"
fi fi
arrApiTest=$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName) arrApiTest=$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName)
if [ "$arrApiTest" == "$arrName" ]; then if [ "$arrApiTest" == "$arrName" ]; then
break break
else else
log "$arrName is not ready, sleeping until valid response..." log "$arrName is not ready, sleeping until valid response..."
sleep 1 sleep 1
fi fi
done done
} }
# Install packages # Install packages
@ -123,15 +123,15 @@ PackageInstallation
arrName="$(cat /config/config.xml | xq | jq -r .Config.InstanceName)" arrName="$(cat /config/config.xml | xq | jq -r .Config.InstanceName)"
if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ] || [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ] || [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then
for (( ; ; )); do for (( ; ; )); do
let i++ let i++
log "Starting..." log "Starting..."
QueueCleanerProcess QueueCleanerProcess
log "Sleeping $scriptInterval..." log "Sleeping $scriptInterval..."
sleep $scriptInterval sleep $scriptInterval
done done
else else
log "ERROR :: Arr app not detected, exiting..." log "ERROR :: Arr app not detected, exiting..."
fi fi
exit exit