diff options
author | Antonio Hernández Blas <hba.nihilismus@gmail.com> | 2010-05-13 01:00:01 +0200 |
---|---|---|
committer | David Somero <xgizzmo@slackbuilds.org> | 2010-05-13 01:00:01 +0200 |
commit | f986af338a4cfcceb99942550d1df4d049d752bd (patch) | |
tree | 54309dc28fc3b530588b32107a49b6b887ce66f7 /network/hiawatha/rc.php-fcgi | |
parent | 9a16c49703edec5f2b9b8cae7ab1a76ff6241e75 (diff) | |
download | slackbuilds-f986af338a4cfcceb99942550d1df4d049d752bd.tar.gz |
network/hiawatha: Added to 13.0 repository
Diffstat (limited to 'network/hiawatha/rc.php-fcgi')
-rw-r--r-- | network/hiawatha/rc.php-fcgi | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/network/hiawatha/rc.php-fcgi b/network/hiawatha/rc.php-fcgi new file mode 100644 index 0000000000..577beed99b --- /dev/null +++ b/network/hiawatha/rc.php-fcgi @@ -0,0 +1,58 @@ +#!/bin/sh + +# Start/stop/restart PHP as FastCGI daemon +# Copyright (c) 2009 Antonio Hernández Blas <hba.nihilismus@gmail.com> + +CONF='/etc/hiawatha/php-fcgi.conf' +CMMD="/usr/sbin/php-fcgi -c $CONF" + +php_fcgi_start() { + if [ -x /usr/sbin/php-fcgi ]; then + if [ -f $CONF ]; then + PIDOF=$(pgrep -f /usr/bin/php-cgi) + if [ ! -z "$PIDOF" ]; then + echo "Error, PHP as FastCGI daemon is already running." + else + echo "Starting PHP as FastCGI daemon: $CMMD" + $CMMD + fi + else + echo "Error, file $CONF does not exist." + fi + fi +} + +php_fcgi_stop() { + echo "Stoping PHP as FastCGI daemon: /usr/sbin/php-fcgi -k" + /usr/sbin/php-fcgi -k +} + +php_fcgi_status() { + PIDOF=$(pgrep -f /usr/bin/php-cgi) + if [ ! -z "$PIDOF" ]; then + echo "PHP as FastCGI daemon is running." + else + echo "PHP as FastCGI daemon is not running." + fi +} + +case $1 in + start) + php_fcgi_start + ;; + stop) + php_fcgi_stop + ;; + restart) + php_fcgi_stop + sleep 1 + php_fcgi_start + ;; + status) + php_fcgi_status + ;; + *) + echo "Usage $0 {start|stop|restart|status}" + exit 1 + ;; +esac |