Skip to content

Commit

Permalink
Auto refresh added on log errors [WIP] thanks to @benyanke
Browse files Browse the repository at this point in the history
  • Loading branch information
guysoft committed Aug 30, 2018
1 parent 792a407 commit 379204e
Showing 1 changed file with 19 additions and 0 deletions.
@@ -1,2 +1,21 @@
#!/bin/bash

# Standard behavior - runs chrome
chromium-browser --kiosk --touch-events=enabled --disable-pinch --noerrdialogs --disable-session-crashed-bubble --app=$(head -n 1 /boot/fullpageos.txt)
exit;

# Remove the two lines above to enable signage mode - refresh the browser whenever errors are seen in log

chromium-browser --enable-logging --v=1 --kiosk --touch-events=enabled --disable-pinch --noerrdialogs --disable-session-crashed-bubble --app=$(head -n 1 /boot/fullpageos.txt) &

export logfile="/home/pi/.config/chromium/chrome_debug.log"


# Refreshes after a crash by watching logs
tail -n 0 -f "$logfile" | while read LOGLINE &> /dev/null; do

echo "Refreshing after crash"
echo "Restarting at `date` after a reported crash. Logline: ${LOGLINE}" >> /tmp/crashlog
[[ "${LOGLINE}" == *"ERROR"* ]] && /home/pi/scripts/refresh

done

0 comments on commit 379204e

Please sign in to comment.