aboutsummaryrefslogtreecommitdiff
path: root/ftp/vsftpd/files/vsftpd.sh.in
blob: 6f86deae4574adca044e4de836ca19872a5a7a55 (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
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: vsftpd
# REQUIRE: DAEMON
# KEYWORD: FreeBSD

# Add the following line to /etc/rc.conf to enable `vsftpd':
#
# vsftpd_enable="YES"
# vsftpd_flags="/some/path/conf.file" # Not required
#

. "%%RC_SUBR%%"

name="vsftpd"
rcvar=`set_rcvar`

load_rc_config "$name"
: ${vsftpd_enable="NO"}
: ${vsftpd_flags=""}

command="%%PREFIX%%/libexec/$name ${vsftpd_flags}"
required_files="%%PREFIX%%/etc/$name.conf"

vsftpd_check()
{
	cat ${required_files} | egrep -E "^listen.*=.*YES$" > /dev/null
	if [ $? = 1 ]; then
		err 1 "vsftpd script need "listen=YES" on config file"
	fi
	cat ${required_files} | egrep -E "^background.*=.*YES$" > /dev/null
	if [ $? = 1 ]; then
		err 1 "vsftpd script need "background=YES" on config file"
	fi
}

vsftpd_check

run_rc_command "$1"