From d12c4a8376992cc24e03a9eac1fb6952fb493b9b Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Thu, 20 Jul 2023 10:49:16 +0000 Subject: [PATCH] Update functions.bash --- universal/functions.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/universal/functions.bash b/universal/functions.bash index 6338df7..448d8b4 100644 --- a/universal/functions.bash +++ b/universal/functions.bash @@ -1,14 +1,15 @@ log () { m_time=`date "+%F %T"` echo $m_time" :: $scriptName :: $scriptVersion :: "$1 + echo $m_time" :: $scriptName :: $scriptVersion :: "$1 >> /config/logs/$scriptName.txt } logfileSetup () { # auto-clean up log file to reduce space usage if [ -f "/config/logs/$scriptName.txt" ]; then - if find /config/logs -type f -name "$scriptName.txt" -size +1024k | read; then - echo "" > /config/logs/$scriptName.txt - fi + if find /config/logs -type f -name "$scriptName.txt" -size +1024k | read; then + echo "" > /config/logs/$scriptName.txt + fi fi if [ ! -f "/config/logs/$scriptName.txt" ]; then