Hi, I'm using Bob every day on linux, and I often come back to the computer after being away and its often disconnected, and a simple browser reload doesn't work.
I have this script running every 30 minutes on a cronjob, but it doesn't always work
if ! pgrep -x "node" > /dev/null
then
echo "node is Stopped, restarting"
yad --text="Starting up the Bob..." --timeout=1 --center ;cd /home/david/SyncthingFolders/Bob/TiddlyWiki5;node ./tiddlywiki.js Wikis/BobWiki --wsserver;
else
echo node is running
yad --text="node is running fine" --timeout=1 --center
fi
i.e., sometimes if I do this at the terminal
it returns a process ID indicating node is running, but I still have to ``pkill node`` to get Bob going.
Is there a better way (by script) to detect if Bob is running properly so I don't have the cronjob kill the script (if I just pkill every 30 minutes) while I'm working in it?
Thanks,
- Dave
P.S. I just noticed that now that Bob is running there are actually 2 processes of node running now. Is that a reliable indicator? If so I'm sure I could detect that in a script