Update Recyclarr

This commit is contained in:
billsbdb3 2024-07-03 14:34:20 -04:00 committed by GitHub
parent 9676849fb1
commit 512286de02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,8 +9,10 @@ source /config/extended/functions
#### Create Log File #### Create Log File
logfileSetup logfileSetup
logfile="/config/logs/$logFileName"
# Redirect all output to the log file # Redirect all output to the log file
exec &> >(tee -a "/config/logs/$logFileName") exec &> >(tee -a "$logfile")
#### Check Arr App #### Check Arr App
getArrAppInfo getArrAppInfo
@ -28,12 +30,12 @@ verifyConfig () {
fi fi
} }
RecyclarrProcess () { RecyclarrProcess () {
# Configure Yaml with URL and API Key # Configure Yaml with URL and API Key
sed -i "s%arrUrl%$arrUrl%g" "/config/extended/recyclarr.yaml" 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" log "Updating Arr via Recyclarr"
if [ ! -d /config/extended/recyclarr-data ]; then if [ ! -d /config/extended/recyclarr-data ]; then
mkdir -p /config/extended/recyclarr-data mkdir -p /config/extended/recyclarr-data
@ -41,9 +43,9 @@ RecyclarrProcess () {
fi fi
# Run Recyclarr and capture the output # Run Recyclarr and capture the output
while IFS= read -r line; do /recyclarr/recyclarr sync -c $recyclarrConfig --app-data /config/extended/recyclarr-data 2>&1 | tee -a "$logfile" | while IFS= read -r line; do
log "$line" echo "$(date "+%F %T") :: $scriptName :: $scriptVersion :: $line"
done < <(/recyclarr/recyclarr sync -c $recyclarrConfig --app-data /config/extended/recyclarr-data 2>&1) done >> "$logfile"
log "Complete" log "Complete"
} }