aboutsummaryrefslogtreecommitdiff
path: root/ftp/ftpsesame/files/ftpsesame.in
diff options
context:
space:
mode:
Diffstat (limited to 'ftp/ftpsesame/files/ftpsesame.in')
-rw-r--r--ftp/ftpsesame/files/ftpsesame.in45
1 files changed, 45 insertions, 0 deletions
diff --git a/ftp/ftpsesame/files/ftpsesame.in b/ftp/ftpsesame/files/ftpsesame.in
new file mode 100644
index 000000000000..6bcb29a525b3
--- /dev/null
+++ b/ftp/ftpsesame/files/ftpsesame.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ftpsesame
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable ftpsesame
+#
+# ftpsesame_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable.
+# ftpsesame_interface (str): Interface name where ftp sessions will listen.
+# (Usualy an external interface)
+# ftpsesame_flags (str): Additional options (See ftpsesame(8)).
+#
+
+. /etc/rc.subr
+
+name=ftpsesame
+rcvar=ftpsesame_enable
+command=%%PREFIX%%/bin/${name}
+pidfile="/var/run/${name}.pid"
+
+start_postcmd=start_postcmd
+stop_postcmd=stop_postcmd
+
+start_postcmd()
+{
+ ps -axo pid,comm | awk '/ftpsesame/ {print $1}' > ${pidfile}
+}
+
+stop_postcmd()
+{
+ rm -f ${pidfile}
+}
+
+# set defaults
+ftpsesame_enable=${ftpsesame_enable:-"NO"}
+
+load_rc_config $name
+command_args=${ftpsesame_interface:+"-i ${ftpsesame_interface}"}
+run_rc_command "$1"