freebsd-ports/net/socat/files/socat.in
Emanuel Haupt ef17068bee Change rc script to launch socat using daemon and remove the unnecessary
wrapper script.

PR:		176321
Submitted by:	Mark Felder <feld@feld.me>
2013-03-08 06:40:12 +00:00

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"