1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-16 03:24:07 +00:00
freebsd-ports/ftp/atftp/files/atftpd.in
2015-01-14 02:43:29 +00:00

44 lines
814 B
Bash

#!/bin/sh
# PROVIDE: atftpd
# REQUIRE: NETWORKING
# 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=atftpd_enable
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} %%PREFIX%%/tftp"
start_precmd="start_precmd"
stop_postcmd="stop_postcmd"
start_precmd()
{
touch ${logfile}
chown nobody ${logfile}
}
stop_postcmd()
{
rm -f ${pidfile}
}
run_rc_command "$1"