Page 1 of 1

Script to Auto Reboot pi or program when crashes occurs

Posted: Mon Oct 10, 2016 10:33 am
by sirus
Hi Guys,

I have a pi set up to run several programs e.g. kodi, emulationstation, vlc. I have been getting issues where a program crashes, so I was consider solving the problem with writing a script that maybe runs on startup that constantly checks what programe is currently in use and looks out to see if has crashed for x amount of time.

The logic in my head is something like:

If (Kodi == Open)
While(KODI == OPEN)
(IF KODI STAUTUS = CRASH && crash time > 1000)
PI REBOOT OR KODI RESTART
End If
End While
Else If (EmalationStation == Open)
While(EmalationStation == OPEN)
(IF EmalationStation STAUTUS = CRASH && crash time > 1000)
PI REBOOT OR EmalationStation RESTART
End If
End While
End If

Hopefully thats clear on what im trying to achieve.

Thank you.