Return to Snippet

Revision: 39037
at January 12, 2011 13:25 by wnasich


Initial Code
#! /bin/bash
###########################################
port_check=`/usr/sbin/lsof -i :[port-number]|wc -l`
###########################################

if [ $port_check -ge "1" ]; then
	exit 0
else
	pkill -f '/usr/local/bin/php -f /home/path/to/file.php'
	/usr/local/bin/php -f /home/path/to/file.php > /dev/null &
fi

Initial URL
http://forums.cpanel.net/f5/check-php-cli-process-running-184662.html

Initial Description


Initial Title
Ensure a PHP CLI process always active

Initial Tags
php

Initial Language
Bash