diff --git a/radarr/AutoExtras.service b/radarr/AutoExtras.service index 988750c..793fd91 100644 --- a/radarr/AutoExtras.service +++ b/radarr/AutoExtras.service @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.3" +scriptVersion="1.4" scriptName="AutoExtras" log () { @@ -8,18 +8,21 @@ log () { } logfileSetup () { - # auto-clean up log file to reduce space usage - if [ -f "/config/logs/AutoExtras.txt" ]; then - find /config/logs -type f -name "QueueCleaner.txt" -size +1024k -delete - fi - - if [ ! -f "/config/logs/AutoExtras.txt" ]; then - touch "/config/logs/AutoExtras.txt" - chmod 666 "/config/logs/AutoExtras.txt" - fi - exec &> >(tee -a "/config/logs/AutoExtras.txt") + # auto-clean up log file to reduce space usage + if [ -f "/config/logs/$scriptName.txt" ]; then + find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete + fi + + if [ ! -f "/config/logs/$scriptName.txt" ]; then + touch "/config/logs/$scriptName.txt" + chmod 666 "/config/logs/$scriptName.txt" + fi } +# Create Log, start writing... +logfileSetup +exec &> >(tee -a "/config/logs/$scriptName.txt") + verifyConfig () { #### Import Settings source /config/extended.conf