Corrected off by one in cron script due to empty log file potentially existing

This commit is contained in:
Anon 2023-08-05 15:31:50 -07:00
parent 18961ba5e2
commit 647c5fa894

View File

@ -30,11 +30,11 @@ ENTRY='./run.sh'
# cd into the bot's root path, set up the virtual environment, and run # cd into the bot's root path, set up the virtual environment, and run
cd "$RUN_DIR" cd "$RUN_DIR"
[ ! -f "$ENTRY" ] && echo "Cannot find entry: ${ENTRY}" && cd - > /dev/null && exit 1 [ ! -f "$ENTRY" ] && echo "Cannot find entry: ${ENTRY}" && cd - > /dev/null && exit 1
if [ ! -f "$LOG" ]; then if [ ! -s "$LOG" ]; then
"$ENTRY" "$ENTRY" "$@"
else else
LINE="$(expr `grep "^Profile" "$LOG" | grep -o '[0-9]*$' | tail -n 1` + 1)" LINE="$(expr `grep "^Profile" "$LOG" | grep -o '[0-9]*$' | tail -n 1` + 1)"
"$ENTRY" -l "$LINE" "$ENTRY" "$@" -l "$LINE"
fi fi
RETURN_CODE="$?" RETURN_CODE="$?"