parent
22d997bb99
commit
2c93170ab2
1 changed files with 12 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
scriptVersion="1.2"
|
scriptVersion="1.3"
|
||||||
scriptName="QueueCleaner"
|
scriptName="QueueCleaner"
|
||||||
|
|
||||||
log () {
|
log () {
|
||||||
|
@ -103,9 +103,9 @@ verifyApiAccess () {
|
||||||
do
|
do
|
||||||
arrApiTest=""
|
arrApiTest=""
|
||||||
arrApiVersion=""
|
arrApiVersion=""
|
||||||
if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ]; then
|
if [ "$arrName" == "8989" ] || [ "$arrPort" == "7878" ]; then
|
||||||
arrApiVersion="v3"
|
arrApiVersion="v3"
|
||||||
elif [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then
|
elif [ "$arrPort" == "8686" ] || [ "$arrPort" == "8787" ]; 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)
|
||||||
|
@ -118,19 +118,14 @@ verifyApiAccess () {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
arrName="$(cat /config/config.xml | xq | jq -r .Config.InstanceName)"
|
for (( ; ; )); do
|
||||||
if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ] || [ "$arrName" == "Lidarr" ] || [ "$arrName" == "Readarr" ]; then
|
let i++
|
||||||
for (( ; ; )); do
|
logfileSetup
|
||||||
let i++
|
verifyConfig
|
||||||
logfileSetup
|
log "Starting..."
|
||||||
verifyConfig
|
QueueCleanerProcess
|
||||||
log "Starting..."
|
log "Sleeping 15m..."
|
||||||
QueueCleanerProcess
|
sleep 15m
|
||||||
log "Sleeping 15m..."
|
done
|
||||||
sleep 15m
|
|
||||||
done
|
|
||||||
else
|
|
||||||
log "ERROR :: Arr app not detected, exiting..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
Loading…
Reference in a new issue