Hello,
because i crashed my Pimatic the last days a little bit more often.
i wrote me a little watchdog script wich looks if pimatic is running and if not restarts it.
Maybe someone needs this too…
#!/bin/bash
PROZ="pimatic.js"
PID=$(pgrep -x $PROZ)
if [[ ! -z $PID ]] ; then
echo "[$(date +"%Y-%m-%d %H:%M")] $PROZ laeuft"
else
echo "[$(date +"%Y-%m-%d %H:%M")] $PROZ wurde neu gestartet" >> /var/log/$PROZ-watchdog.log
sudo /home/pi/pimatic-app/node_modules/pimatic/$PROZ start
fi
exit 0
save as watchdog.sh
make executable
new crontab
sudo crontab -e
insert
* * * * * bash /path/to/watchdog.sh >/dev/null 2>&1
(looks every minute)
thats it
Mit freundlichen Grüßen
Chris