-
-
Save Ttech/271600 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. /etc/rc.conf | |
. /etc/rc.d/functions | |
$spawncgi=/usr/bin/spawn-fcgi | |
$daemon_name = php-cgi | |
ARGS=-" -a 127.0.0.1 -p 9000 -f /usr/bin/php-cgi -U http" | |
case "$1" in | |
start) | |
stat_busy "Starting Fast CGI Daemon" | |
if $spawncgi $ARGS &>/dev/null ; then | |
add_daemon $daemon_name | |
stat_done | |
else | |
stat_fail | |
exit 1 | |
fi | |
;; | |
;; | |
stop) | |
stat_busy "Stopping Fast CGI Daemon" | |
if killall -9 $daemon_name &>/dev/null ; then | |
rm_daemon $daemon_name | |
stat_done | |
else | |
stat_fail | |
exit 1 | |
fi | |
;; | |
restart) | |
if killall -9 $daemon_name &>/dev/null ; then | |
add_daemon $daemon_name | |
stat_done | |
else | |
stat_fail | |
exit 1 | |
fi | |
;; | |
status) | |
stat_busy "Checking "Fast CGI Daemon Status"; | |
ck_status $daemon_name | |
;; | |
*) | |
echo "Usage: fcgi {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment