summaryrefslogtreecommitdiff
path: root/ftp/bsdftpd-ssl/files/bsdftpd-ssl.sh
blob: a5f27ddfca2f83ba2f3f4454bf1546bb056db8a6 (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
#!/bin/sh

# Add extra options here for the BSDftpd-ssl FTP server.
# See ftpd-ssl(8) for more details.
EXTRAOPTS="-l"

# You shouldn't edit anything below...
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    echo "$0: Cannot determine the PREFIX" >&2
    exit 1
fi

case "$1" in
start)
	if [ -x ${PREFIX}/libexec/ftpd ]; then
		${PREFIX}/libexec/ftpd -D -p /var/run/ftpd.pid ${EXTRAOPTS} > /dev/null
		echo -n ' BSDftpd-ssl'
	fi
	;;
stop)
	if [ -r /var/run/ftpd.pid ]; then
		kill -TERM `cat /var/run/ftpd.pid`
		rm -f /var/run/ftpd.pid
		echo -n ' BSDftpd-ssl'
	fi
	;;
*)
	echo ""
	echo "Usage: `basename $0` { start | stop }"
	echo ""
	exit 1
	;;
esac

exit 0