v1.9 Improved logging

This commit is contained in:
RandomNinjaAtk 2023-07-14 11:26:34 +00:00 committed by GitHub
parent 2ebfe2badb
commit 008524ef38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 "|~\(_|| |(_|(_)| | || \||| |_|(_||~| | |<"