aboutsummaryrefslogtreecommitdiff
path: root/net/udpxy/files/udpxy.in
blob: e2b69c861456da1bcfcd2142512b64fd0f115de1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: udpxy
# REQUIRE: NETWORKING

# Define these udpxy_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/udpxy
#
# udpxy_enable (bool):	Set to "NO" by default.
#			Set it to "YES" to enable udpxy.
# udpxy_port (number):	Set to "4022" by default.
#			Set listening port number.
# udpxy_flags (str):    Set to "-S" by default.
#                       Extra flags passed to start command.

. /etc/rc.subr

name="udpxy"
rcvar=$(set_rcvar)

udpxy_enable=${udpxy_enable-"NO"}
udpxy_port=${udpxy_port-"4022"}
udpxy_flags=${udpxy_flags-"-S"}
command="%%PREFIX%%/sbin/${name}"
pidfile="/var/run/${name}${udpxy_port}.pid"
command_args="-p ${udpxy_port} ${udpxy_flags}"

load_rc_config $name
run_rc_command "$1"