mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-18 03:46:03 +00:00
4940ae5cd4
- Use procname instead of hardcoded /usr/local/bin/socat Submitted by: sunpoet (myself) Approved by: ehaupt (maintainer)
40 lines
738 B
Bash
40 lines
738 B
Bash
#!/bin/sh
|
|
#
|
|
# Author: Emanuel Haupt <ehaupt@FreeBSD.org>
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: socat
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
|
|
# Add the following lines to /etc/rc.conf to enable socat:
|
|
# socat_enable="YES"
|
|
# socat_flags="<set as needed>"
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="socat"
|
|
rcvar=socat_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${socat_enable="NO"}
|
|
|
|
start_precmd="socat_prestart"
|
|
pidfile=/var/run/socat.pid
|
|
procname="%%PREFIX%%/bin/socat"
|
|
command=/usr/sbin/daemon
|
|
command_args=" -f -p ${pidfile} ${procname} ${socat_flags}"
|
|
|
|
socat_prestart()
|
|
{
|
|
# socat_flags gets applied too early if we don't do this.
|
|
# I didn't want to force people to update their rc.conf files
|
|
# and change the socat_flags to something else.
|
|
rc_flags=""
|
|
}
|
|
|
|
run_rc_command "$1"
|