summaryrefslogtreecommitdiff
path: root/net-ftp/pure-ftpd/files/pure-uploadscript.initd-r1
blob: 5914c875fdf178993bf95f13477c2b05d0cb1e88 (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
#!/sbin/openrc-run
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

ftpd_configfile="/etc/pure-ftpd.conf"
pidfile="/run/pure-uploadscript.pid"

command="/usr/sbin/pure-uploadscript"
command_args="${UPLOADSCRIPT}"
command_background="true"

depend() {
	need localmount
	use netmount
}

start_pre() {
	if [ -n "${UPLOADSCRIPT}" ] ; then
		eerror "The file ${ftpd_configfile} does not exist!"
		eerror "Please create and configure the uploadscript file."
		return 1
	fi

	if ! grep "^CallUploadScript" "${ftpd_configfile}" ; then
		eerror "You cannot start this uploadscript,"
		eerror "unless you enable the option CallUploadScript"
		eerror "in your main Pure-FTPd configuration file ${ftpd_configfile}"
		return 1
	fi
}