From 647c5fa894a73ef9a63dd89576abf33c833a657a Mon Sep 17 00:00:00 2001 From: Anon Date: Sat, 5 Aug 2023 15:31:50 -0700 Subject: [PATCH] Corrected off by one in cron script due to empty log file potentially existing --- cron.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cron.sh b/cron.sh index 6e5129c..6128fa9 100755 --- a/cron.sh +++ b/cron.sh @@ -30,11 +30,11 @@ ENTRY='./run.sh' # cd into the bot's root path, set up the virtual environment, and run cd "$RUN_DIR" [ ! -f "$ENTRY" ] && echo "Cannot find entry: ${ENTRY}" && cd - > /dev/null && exit 1 -if [ ! -f "$LOG" ]; then - "$ENTRY" +if [ ! -s "$LOG" ]; then + "$ENTRY" "$@" else LINE="$(expr `grep "^Profile" "$LOG" | grep -o '[0-9]*$' | tail -n 1` + 1)" - "$ENTRY" -l "$LINE" + "$ENTRY" "$@" -l "$LINE" fi RETURN_CODE="$?"