1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-15 07:56:36 +00:00
freebsd-ports/net/redir/files/redir.in
2021-04-06 16:31:13 +02:00

36 lines
652 B
Bash

#!/bin/sh
# PROVIDE: redir
# REQUIRE: DAEMON
#
# Add the following lines to /etc/rc.conf to enable redir:
#
# redir_enable (bool): Set it to "YES" to enable redir.
# Default is "NO".
# redir_flags (flags): Set flags to redir.
# Default is "". see redir(1).
# Example: "--lport=80 --cport=3128 --syslog"
#
. /etc/rc.subr
name="redir"
rcvar=redir_enable
load_rc_config $name
: ${redir_enable="NO"}
command=%%PREFIX%%/bin/redir
command_args="&"
start_precmd="${name}_flags_check"
redir_flags_check()
{
if [ "${redir_flags}" = "" ]; then
err 1 "\$redir_flags are required. see available options in redir(1)"
fi
}
run_rc_command "$1"