@sdetweil Seems a bit of a over kill when node restart and browser hard refresh is a matter of seconds and does exactly the same. Who wants this constantly full restart thing on the wall, on the pie zero on server restart I get no white screen at all stays as back ground and maybe 10 secs to fill again with content so for Pi2/3 you could blink and miss it.
I will prob have some further system log monitor actions but the pi watchdog will force a restart if seizes.
Cron is a really bad way to do it as it quite simple to get a notification exactly when its ready and also not just do it on a time loop when its not so you end up with the horrid white chromium refresh screen.
Tail and log monitoring is where linux excels.
( tail -f -n0 ~/.pm2/logs/MagicMirror-out.log & ) | grep -q 'Ready to go! Please point your browser to:'
sh xdotool.sh
Thats it job done.
PM2 only tests that MagicMirror is loaded and running as ‘Ready to go! Please point your browser to:’ comes on my lowly zero quite a bit after PM2 says MagicMirror is running.
Also as I say with when the browser and server (Magic Mirror) become disconnected they stay that way with Pi0/1 Electron will launch again but actually its not necessary as all that is needed is a hard refresh.
You can test this on a Pi2/3 with the setup I did for zero but it will work for 2/3 and also uses Stretch lite which has always confused me why the relatively pointless desktop load is used for a mirror.
Just change three lines and use chromium instead if you follow https://github.com/StuartIanNaylor/MagicMirror-Install-Guide-Raspberry-0-to-3
Really electron / server should be 2 PM2 processes as this would work more seamlessly as its an assumption but electron is just Chromium in a java wrapper with the selenium webdrivers so expecting it takes time to reload after being killed and likely that it wasn’t really required.
When this Banana stops twisting my melon as if I can not get I2C running on it then its destined for the bin, but if I do I will have look if I am wrong about the speed of killing electron each timeinstead of just doing a hard refresh.
As of course you can do a refresh as long as its a hard refresh ctrl+F5 and not ctrl+r or F5.
https://www.getfilecloud.com/blog/2015/03/tech-tip-how-to-do-hard-refresh-in-browsers/#.XHcXXIj7SUk