EHCP-Force-Edition/ehcp/ehcpdaemon2.sh

17 lines
532 B
Bash
Raw Permalink Normal View History

2018-04-02 22:26:17 +00:00
#!/bin/bash
# This small shell is written to re-run php based daemon in case of failure..
# because php based daemon quits sometime ocasionally or un-expectedly...
# Changed the way this works by using a function that respawns the php script if it exits.
# Changed by: earnolmartin@gmail.com
function startPHPDaemon(){
cd /var/www/new/ehcp
until php index.php daemon ; do
echo "Server php index.php daemon crashed with exit code -1. Respawning..." >&2
sleep 3
done
startPHPDaemon
}
# Start the initial loop
startPHPDaemon