From 512286de020aec366506e1457f4ad9d1f5e8b093 Mon Sep 17 00:00:00 2001 From: billsbdb3 <64713235+billsbdb3@users.noreply.github.com> Date: Wed, 3 Jul 2024 14:34:20 -0400 Subject: [PATCH] Update Recyclarr --- universal/services/Recyclarr | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/universal/services/Recyclarr b/universal/services/Recyclarr index f7ce305..8f20e24 100644 --- a/universal/services/Recyclarr +++ b/universal/services/Recyclarr @@ -9,8 +9,10 @@ source /config/extended/functions #### Create Log File logfileSetup +logfile="/config/logs/$logFileName" + # Redirect all output to the log file -exec &> >(tee -a "/config/logs/$logFileName") +exec &> >(tee -a "$logfile") #### Check Arr App getArrAppInfo @@ -28,12 +30,12 @@ verifyConfig () { fi } -RecyclarrProcess () { +RecyclarrProcess () { # Configure Yaml with URL and API Key sed -i "s%arrUrl%$arrUrl%g" "/config/extended/recyclarr.yaml" - sed -i "s%arrApi%$arrApiKey%g" "/config/extended/recyclarr.yaml" + sed -i "s%arrApi%$arrApiKey%g" "/config/extended/recyclarr.yaml" - # Update arr app + # update arr app log "Updating Arr via Recyclarr" if [ ! -d /config/extended/recyclarr-data ]; then mkdir -p /config/extended/recyclarr-data @@ -41,9 +43,9 @@ RecyclarrProcess () { fi # Run Recyclarr and capture the output - while IFS= read -r line; do - log "$line" - done < <(/recyclarr/recyclarr sync -c $recyclarrConfig --app-data /config/extended/recyclarr-data 2>&1) + /recyclarr/recyclarr sync -c $recyclarrConfig --app-data /config/extended/recyclarr-data 2>&1 | tee -a "$logfile" | while IFS= read -r line; do + echo "$(date "+%F %T") :: $scriptName :: $scriptVersion :: $line" + done >> "$logfile" log "Complete" }