mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 17:46:38 -04:00
Add rc.d script and option to use PID file. Switch to DISTVERSION. Add license information. PR: 269722 Approved by: maintainer timeout (3+ weeks)
46 lines
1.2 KiB
Bash
46 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: ftpproxy
|
|
# REQUIRE: LOGIN FILESYSTEMS ftp
|
|
# KEYWORD: shutdown
|
|
#
|
|
# ftpproxy_enable (bool): Set to "YES" to enable ftpproxy.
|
|
# (default: "NO")
|
|
#
|
|
# ftpproxy_config (str): Name of ftpproxy config file
|
|
# (default: "/usr/local/etc/ftpproxy.conf")
|
|
#
|
|
# ftpproxy_defaulthost (str): Name of ftp server to connect to.
|
|
# (default: "localhost")
|
|
#
|
|
# ftpproxy_flags (str): Additional flags for ftpproxy
|
|
# (default: "")
|
|
#
|
|
# ftpproxy_user (str): The user to run ftpproxy as
|
|
# (default: "root")
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=ftpproxy
|
|
rcvar=ftpproxy_enable
|
|
pidfile="/var/run/ftpproxy.pid"
|
|
start_cmd="${name}_start"
|
|
command="%%PREFIX%%/sbin/ftp.proxy"
|
|
|
|
load_rc_config $name
|
|
|
|
: ${ftpproxy_enable="NO"}
|
|
: ${ftpproxy_config="%%PREFIX%%/etc/ftpproxy.conf"}
|
|
: ${ftpproxy_defaulthost="localhost"}
|
|
: ${ftpproxy_flags=""}
|
|
: ${ftpproxy_user="root"}
|
|
|
|
ftpproxy_start()
|
|
{
|
|
/usr/bin/install -o ${ftpproxy_user} /dev/null ${pidfile}
|
|
/usr/bin/su -m ${ftpproxy_user} -c "${command} -f ${ftpproxy_config} \
|
|
-P ${pidfile} ${ftpproxy_flags} ${ftpproxy_defaulthost}"
|
|
}
|
|
|
|
run_rc_command "$1"
|