Skip to content

Commit

Permalink
Tweak watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwords committed Mar 5, 2024
1 parent 77943f2 commit 691ba83
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions misc/watchdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 691ba83

Please sign in to comment.