aboutsummaryrefslogtreecommitdiffstats
path: root/devel/p4p/files/p4p.in
blob: aa407e4d089f6305b5120e51ce6085bb7df773f2 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: p4p
# REQUIRE: LOGIN
# KEYWORD: shutdown

# These variables (and many more) can be set via environment variables. Check
# p4p -h for what you can set.
#
# Add the following line to /etc/rc.conf to enable p4p:
# p4p_enable (bool):    Set to "NO" by default.
#           Set it to "YES" to enable p4p.
# p4p_cache (str):  Default to "%%P4CACHE%%".
#           Base cache directory.
# p4p_port (int):   Default to "1666".
#           Set to TCP port to bind to.
# p4p_target (str): Default to "perforce:1666".
#           Target server to cache.
# p4p_debug (str):  Default to "server=3".
#           Debug options. Highly recommended.
# p4p_log (str):    Default to "%%P4LOG%%".
#           Logfile for debug output.
# p4p_args (str):   Custom additional arguments to be passed
#           to p4p (default empty).
#

. /etc/rc.subr

name="p4p"
rcvar=p4p_enable

load_rc_config $name

: ${p4p_enable="NO"}
: ${p4p_cache="%%P4CACHE%%"}
: ${p4p_port="1666"}
: ${p4p_target="perforce:1666"}
: ${p4p_debug="server=3"}
: ${p4p_log="%%P4LOG%%"}

command="%%PREFIX%%/sbin/p4p"
command_args="-r ${p4p_cache} -p ${p4p_port} -t ${p4p_target} -v ${p4p_debug} -L ${p4p_log} -d ${p4p_args} > /dev/null 2>&1 &"
p4p_user="p4admin"

run_rc_command "$1"