updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / php-fcgid / php-fcgi
blobc31b2a5cb887bd0adb34cb73672d5fe3da58fefa
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 NAME="php-fcgi"
8 EXECUTABLE="/usr/bin/php-cgi"
9 BIND="127.0.0.1:1026"
11 PID=`pidof -o %PPID $EXECUTABLE`
13 case "$1" in
14 start)
15 stat_busy "Starting $NAME Daemon"
16 [ -z "$PID" ] && $EXECUTABLE -b $BIND 2>&1 &
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 add_daemon $NAME
21 stat_done
24 stop)
25 stat_busy "Stopping $NAME Daemon"
26 [ ! -z "$PID" ] && kill $PID &>/dev/null
27 if [ $? -gt 0 ]; then
28 stat_fail
29 else
30 rm_daemon $NAME
31 stat_done
34 restart)
35 $0 stop
36 sleep 1
37 $0 start
40 echo "usage: $0 {start|stop|restart}"
41 esac