From 008524ef38f7c4f56ab93b091258afb3d9157946 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 14 Jul 2023 11:26:34 +0000 Subject: [PATCH] v1.9 Improved logging --- lidarr/Video.service.bash | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lidarr/Video.service.bash b/lidarr/Video.service.bash index e9b3017..597f41c 100644 --- a/lidarr/Video.service.bash +++ b/lidarr/Video.service.bash @@ -1,5 +1,5 @@ #!/usr/bin/with-contenv bash -scriptVersion="1.8" +scriptVersion="1.9" scriptName="Video" #### Import Settings @@ -11,6 +11,15 @@ log () { echo $m_time" :: $scriptName :: $scriptVersion :: "$1 } +# auto-clean up log file to reduce space usage +if [ -f "/config/logs/Video.txt" ]; then + find /config/logs -type f -name "Video.txt" -size +5000k -delete + sleep 0.01 +fi +exec &> >(tee -a "/config/logs/Video.txt") +touch "/config/logs/Video.txt" +chmod 666 "/config/logs/Video.txt" + if [ "$enableVideo" != "true" ]; then log "Script is not enabled, enable by setting enableVideo to \"true\" by modifying the \"/config/extended.conf\" config file..." log "Sleeping (infinity)" @@ -69,17 +78,6 @@ if [ "$dlClientSource" = "tidal" ] || [ "$dlClientSource" = "both" ]; then sourcePreference=tidal fi - - -# auto-clean up log file to reduce space usage -if [ -f "/config/logs/Video.txt" ]; then - find /config/logs -type f -name "Video.txt" -size +5000k -delete - sleep 0.01 -fi -exec &> >(tee -a "/config/logs/Video.txt") -touch "/config/logs/Video.txt" -chmod 666 "/config/logs/Video.txt" - log "-----------------------------------------------------------------------------" log "|~) _ ._ _| _ ._ _ |\ |o._ o _ |~|_|_|" log "|~\(_|| |(_|(_)| | || \||| |_|(_||~| | |<"