summaryrefslogtreecommitdiffstats
path: root/ftp/atftp/files/atftpd.in
blob: 505536f0851bc4fe003f1e00bd0a41b81dc50a4c (plain)
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
#!/bin/sh

# PROVIDE: atftpd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# atftpd_enable (bool):		Set to "NO" by default.
# atftpd_flags (str):		Default to "--daemon".
#				Extra flags passed to start command.
#

. /etc/rc.subr

name="atftpd"
rcvar=`set_rcvar`

command=%%PREFIX%%/sbin/${name}
pidfile=/var/run/${name}.pid
logfile=/var/log/${name}.log

load_rc_config $name

[ -z "$atftpd_enable" ]	&& atftpd_enable="NO"
[ -z "$atftpd_flags" ]	&& atftpd_flags="--daemon --verbose=5 --pidfile ${pidfile} --logfile ${logfile} /tftpboot"

start_precmd="start_precmd"
stop_postcmd="stop_postcmd"

start_precmd()
{
	touch ${logfile}
	chown nobody ${logfile}
}

stop_postcmd()
{
	rm -f ${pidfile}
}

run_rc_command "$1"
OpenPOWER on IntegriCloud