47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
#!/sbin/runscript
|
|
# Copyright 1999-2008 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/files/proftpd.rc6,v 1.13 2009/02/17 22:05:07 voyageur Exp $
|
|
|
|
opts="${opts} reload"
|
|
|
|
depend() {
|
|
need net
|
|
use dns
|
|
}
|
|
|
|
checkconfig() {
|
|
if [ ! -e /etc/proftpd/proftpd.conf ] ; then
|
|
eerror "You need an /etc/proftpd/proftpd.conf file first!"
|
|
eerror "There is a sample file in /etc/proftpd."
|
|
return 1
|
|
fi
|
|
ebegin "Checking proftpd configuration"
|
|
/usr/sbin/proftpd -t -c /etc/proftpd/proftpd.conf
|
|
eend $? "Configuration error: please fix your configuration file (/etc/proftpd/proftpd.conf)."
|
|
}
|
|
|
|
start() {
|
|
checkconfig || return 1
|
|
ebegin "Starting proftpd"
|
|
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/proftpd.pid --exec /usr/sbin/proftpd
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping proftpd"
|
|
start-stop-daemon --stop --retry 20 --quiet --pidfile /var/run/proftpd.pid
|
|
eend $?
|
|
}
|
|
|
|
reload() {
|
|
if [ ! -f /var/run/proftpd.pid ] ; then
|
|
eerror "proftpd isn't running!"
|
|
return 1
|
|
fi
|
|
checkconfig || return 1
|
|
ebegin "Reloading proftpd"
|
|
kill -HUP `cat /var/run/proftpd.pid` &>/dev/null
|
|
eend $?
|
|
}
|