From 925070b9216f8b8180e87f41c4642bfd9edb41c2 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Wed, 19 Jul 2023 18:12:41 +0000 Subject: [PATCH] v1.6 - logging fixes --- universal/services/Recyclarr | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/universal/services/Recyclarr b/universal/services/Recyclarr index b08a60d..70b8a5a 100644 --- a/universal/services/Recyclarr +++ b/universal/services/Recyclarr @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.5" +scriptVersion="1.6" scriptName="Recyclarr" log () { @@ -9,17 +9,20 @@ log () { logfileSetup () { # auto-clean up log file to reduce space usage - if [ -f "/config/logs/Recyclarr.txt" ]; then - find /config/logs -type f -name "Recyclarr.txt" -size +1024k -delete + if [ -f "/config/logs/$scriptName.txt" ]; then + find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete fi - if [ ! -f "/config/logs/Recyclarr.txt" ]; then - touch "/config/logs/Recyclarr.txt" - chmod 666 "/config/logs/Recyclarr.txt" + if [ ! -f "/config/logs/$scriptName.txt" ]; then + touch "/config/logs/$scriptName.txt" + chmod 666 "/config/logs/$scriptName.txt" fi - exec &> >(tee -a "/config/logs/Recyclarr.txt") } +# Create Log, start writing... +logfileSetup +exec &> >(tee -a "/config/logs/$scriptName.txt") + verifyConfig () { #### Import Settings source /config/extended.conf