34 lines
548 B
Bash
34 lines
548 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_cmd="${name}_start"
|
|
pidfile=/var/run/socat.pid
|
|
command="%%PREFIX%%/bin/socat"
|
|
|
|
socat_start() {
|
|
echo "Starting ${name}."
|
|
/usr/sbin/daemon -f -p ${pidfile} ${command} ${socat_flags}
|
|
}
|
|
|
|
run_rc_command "$1"
|