freebsd-ports/ftp/ftpsesame/files/ftpsesame.sh.in
Doug Barton 1d6b4b3f91 Begin the process of deprecating sysutils/rc_subr by
s#. %%RC_SUBR%%#. /etc/rc.subr#
2010-03-27 00:15:24 +00:00

45 lines
875 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ftpsesame
# REQUIRE: NETWORKING
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable ftpsesame
#
# ftpsesame_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable.
# ftpsesame_interface (str): Interface name where ftp sessions will listen.
# (Usualy an external interface)
# ftpsesame_flags (str): Additional options (See ftpsesame(8)).
#
. /etc/rc.subr
name=ftpsesame
rcvar=`set_rcvar`
command=%%PREFIX%%/bin/${name}
pidfile="/var/run/${name}.pid"
start_postcmd=start_postcmd
stop_postcmd=stop_postcmd
start_postcmd()
{
ps -axo pid,comm | awk '/ftpsesame/ {print $1}' > ${pidfile}
}
stop_postcmd()
{
rm -f ${pidfile}
}
# set defaults
ftpsesame_enable=${ftpsesame_enable:-"NO"}
load_rc_config $name
command_args=${ftpsesame_interface:+"-i ${ftpsesame_interface}"}
run_rc_command "$1"