From deeceac44f826cad056a31e873012dd94366643c Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Wed, 9 Nov 2022 05:42:43 -0500 Subject: [PATCH] Update MovieExtras.bash --- root/scripts/MovieExtras.bash | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/root/scripts/MovieExtras.bash b/root/scripts/MovieExtras.bash index 4439b81..80ed6f2 100644 --- a/root/scripts/MovieExtras.bash +++ b/root/scripts/MovieExtras.bash @@ -34,24 +34,25 @@ if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then arrUrl="http://127.0.0.1:${arrPort}${arrUrlBase}" fi -log () { - m_time=`date "+%F %T"` - echo $m_time" :: MovieExtras :: "$1 -} - # auto-clean up log file to reduce space usage if [ -f "/config/logs/MovieExtras.txt" ]; then find /config/logs -type f -name "MovieExtras.txt" -size +1024k -delete fi +touch "/config/logs/MovieExtras.txt" +chmod 666 "/config/logs/MovieExtras.txt" +exec &> >(tee -a "/config/logs/MovieExtras.txt") + +log () { + m_time=`date "+%F %T"` + echo $m_time" :: MovieExtras :: $scriptVersion :: "$1 +} + if [ "$arrEventType" == "Test" ]; then log "Tested Successfully" exit 0 fi -exec &>> "/config/logs/MovieExtras.txt" -chmod 777 "/config/logs/MovieExtras.txt" - if [ "$enableExtras" != "true" ]; then log "Script disabled, exiting..." log "Enable by setting enableExtras=true"