Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto refresh added on log errors [WIP] thanks to @benyanke
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/modules/fullpageos/filesystem/home/pi/scripts/start_chromium_browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |