#!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
ftpd_pidfile="/var/run/pure-ftpd.pid"
script_daemon="/usr/sbin/pure-uploadscript"
depend() {
- need net
+ need localmount
+ use netmount
}
start_pre() {
- if [ -z "$IS_CONFIGURED" ] ; then
+ if [ -z "${IS_CONFIGURED}" ] ; then
eerror "You need to setup /etc/conf.d/pure-ftpd first!"
return 1
fi
start() {
UPSCRIPT=""
- if [ -n "$UPLOADSCRIPT" ] ; then
+ if [ -n "${UPLOADSCRIPT}" ] ; then
UPSCRIPT="--uploadscript"
fi
--make-pidfile --background --exec /usr/sbin/pure-ftpd ${WAIT} \
-- $(echo ${FTPD_CONFIG} | sed 's@\([[:space:]]\+\|^\)-B\([[:space:]]\+\|$\)@\1@g')
result=$?
- if [ $result -ne 0 ] ; then
+ if [ ${result} -ne 0 ] ; then
eend 1 "Could not launch Pure-FTPd"
else
eend $result
- if [ -n "$UPLOADSCRIPT" ] ; then
+ if [ -n "${UPLOADSCRIPT}" ] ; then
ebegin "Starting Pure-FTPd upload script"
start-stop-daemon --start --quiet --make-pidfile \
--pidfile ${script_pidfile} \
}
stop() {
- if [ -n "$UPLOADSCRIPT" ] ; then
+ if [ -n "${UPLOADSCRIPT}" ] ; then
ebegin "Stopping Pure-FTPd upload script"
start-stop-daemon --stop --retry 20 --quiet \
--pidfile ${script_pidfile}