v1.0.8 - loging process fix

Change order of operations
This commit is contained in:
RandomNinjaAtk 2023-03-19 10:57:24 -04:00 committed by GitHub
parent 3eb64d675c
commit 5dc4b41537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
scriptVersion="1.0.7"
scriptVersion="1.0.8"
######## Settings
scriptInterval="15m"
@ -14,6 +14,15 @@ log () {
echo $m_time" :: QueueCleaner :: $scriptVersion :: "$1
}
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/QueueCleaner.txt" ]; then
find /config/logs -type f -name "QueueCleaner.txt" -size +1024k -delete
fi
touch "/config/logs/QueueCleaner.txt"
chmod 666 "/config/logs/QueueCleaner.txt"
exec &> >(tee -a "/config/logs/QueueCleaner.txt")
QueueCleanerProcess () {
# Get Arr App information
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
@ -29,15 +38,6 @@ QueueCleanerProcess () {
arrUrl="http://127.0.0.1:${arrPort}${arrUrlBase}"
fi
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/QueueCleaner.txt" ]; then
find /config/logs -type f -name "QueueCleaner.txt" -size +1024k -delete
fi
touch "/config/logs/QueueCleaner.txt"
chmod 666 "/config/logs/QueueCleaner.txt"
exec &> >(tee -a "/config/logs/QueueCleaner.txt")
verifyApiAccess
if [ "$arrName" == "Sonarr" ]; then