From 691ba8372800b7cba4ad1d8e60758bbc7f9aaadc Mon Sep 17 00:00:00 2001 From: Alexei Date: Tue, 5 Mar 2024 16:52:01 -0500 Subject: [PATCH] Tweak watchdog --- misc/watchdog.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/watchdog.sh b/misc/watchdog.sh index 2dc402f..c17e292 100755 --- a/misc/watchdog.sh +++ b/misc/watchdog.sh @@ -15,10 +15,13 @@ if [ ! -f "$logfile" ]; then exit fi -browser=$(grep -oP 'browser: [A-Za-z]+' "$logfile" | cut -d ' ' -f 2-) - # and if the log file hasn't been updated in a while if [ ! "$(find "$logfile" -newermt "6 minutes ago")" ]; then + + # TODO it's possible we are still in the middle of restarting here + + browser=$(grep -oP 'browser: [A-Za-z]+' "$logfile" | cut -d ' ' -f 2-) + # force a restart by killing the browser if [ "$browser" = Chrome ]; then pkill chrome