Update QueueCleaner.bash
This commit is contained in:
parent
6a43634745
commit
6bd5d698a7
1 changed files with 11 additions and 3 deletions
|
@ -1,6 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.0.0"
|
scriptVersion="1.0.0"
|
||||||
|
|
||||||
|
######## Settings
|
||||||
|
scriptInterval="15m"
|
||||||
|
|
||||||
######## Package dependencies installation
|
######## Package dependencies installation
|
||||||
pip install --upgrade --no-cache-dir -U yq &>/dev/null
|
pip install --upgrade --no-cache-dir -U yq &>/dev/null
|
||||||
|
|
||||||
|
@ -76,16 +79,21 @@ QueueCleanerProcess () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "$arrName" == "enableQueueCleaner" ]; then
|
||||||
|
log "ERROR :: Script disabled, exiting..."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
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" ]; then
|
if [ "$arrName" == "Sonarr" ] || [ "$arrName" == "Radarr" ] || [ "$arrName" == "Lidarr" ]; then
|
||||||
log "Waiting for $arrName to startup, sleeping for 2 minutes..."
|
log "Waiting for $arrName to startup, sleeping for 2 minutes..."
|
||||||
#sleep 2m
|
sleep 2m
|
||||||
log "Starting Script...."
|
log "Starting Script...."
|
||||||
for (( ; ; )); do
|
for (( ; ; )); do
|
||||||
let i++
|
let i++
|
||||||
QueueCleanerProcess
|
QueueCleanerProcess
|
||||||
log "Processing complete, sleeping for 15 minutes..."
|
log "Processing complete, sleeping for $scriptInterval..."
|
||||||
sleep 15m
|
sleep $scriptInterval
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
log "ERROR :: Arr app not detected, exiting..."
|
log "ERROR :: Arr app not detected, exiting..."
|
||||||
|
|
Loading…
Reference in a new issue