summaryrefslogtreecommitdiff
path: root/ftp/ftpsesame/files/ftpsesame.in
blob: 47ae719fe1225ba6540a53700727ce42d7289b6e (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
#!/bin/sh

# 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=ftpsesame_enable
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"