Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # $FreeBSD: cgiwrap-fcgi init script v0.5 $
- #
- # PROVIDE: cgiwrap-fcgi
- # REQUIRE: LOGIN
- # BEFORE: securelevel
- # KEYWORD: shutdown
- # Add the following lines to /etc/rc.conf to enable `cgiwrap-fcgi':
- #
- # cgiwrap_fcgi_enable="YES"
- # cgiwrap_fcgi_user="user"
- #
- . /etc/rc.subr
- name="cgiwrap_fcgi"
- sockdir="/var/run/cgiwrap-fcgi"
- rcvar=`set_rcvar`
- command="/usr/local/bin/cgiwrap-fcgi"
- #command_args="&"
- load_rc_config "$name"
- : ${cgiwrap_fcgi_enable="NO"}
- : ${cgiwrap_fcgi_user="$(whoami)"}
- start_cmd="start_cmd"
- start_cmd()
- {
- if [ -n "${sockdir}" ]; then
- mkdir -p ${sockdir} && chown ${cgiwrap_fcgi_user}:${cgiwrap_fcgi_user} ${sockdir}
- fi
- su -m ${cgiwrap_fcgi_user} -c "${command} ${command_args} &"
- }
- run_rc_command "$1"
Add Comment
Please, Sign In to add comment