summaryrefslogtreecommitdiff
path: root/network/pure-ftpd/config/rc.pure-ftpd
diff options
context:
space:
mode:
Diffstat (limited to 'network/pure-ftpd/config/rc.pure-ftpd')
-rw-r--r--network/pure-ftpd/config/rc.pure-ftpd49
1 files changed, 49 insertions, 0 deletions
diff --git a/network/pure-ftpd/config/rc.pure-ftpd b/network/pure-ftpd/config/rc.pure-ftpd
new file mode 100644
index 0000000000..418b0e68ad
--- /dev/null
+++ b/network/pure-ftpd/config/rc.pure-ftpd
@@ -0,0 +1,49 @@
+#!/bin/sh
+# Start/stop/restart pure-ftpd ftp daemon
+
+configfile=/etc/pure-ftpd/pure-ftpd.conf
+pidfile=/var/run/pure-ftpd.pid
+
+pureftpd_start() {
+ if [ -x /usr/sbin/pure-config.pl -a -r "$configfile" ]; then
+ echo "Starting pure-ftpd daemon: "
+ echo "/usr/sbin/pure-config.pl $configfile"
+ /usr/sbin/pure-config.pl $configfile
+ fi
+}
+
+pureftpd_stop() {
+ killall pure-ftpd 2> /dev/null
+ /usr/bin/rm $pidfile 2> /dev/null
+}
+
+pureftpd_restart() {
+ if [ -r "$pidfile" ]; then
+ echo "WARNING: killing listener process only. To kill every pure-ftpd process, you must"
+ echo " use 'rc.pure-ftpd stop'. 'rc.pure-ftpd restart' kills only the parent pure-ftpd"
+ echo " to preserve existing connections. If pure-ftpd has been upgraded, new connections"
+ echo " will now use the new version, which should be a safe enough approach."
+ kill `cat $pidfile`
+ else
+ echo "WARNING: There does not appear to be a parent instance of pure-ftpd running."
+ echo " If you really want to kill all running instances of pure-ftpd (including"
+ echo " any sessions currently in use), run '/etc/rc.d/rc.pure-ftpd stop' instead."
+ exit 1
+ fi
+ sleep 1
+ pureftpd_start
+}
+
+case "$1" in
+'start')
+ pureftpd_start
+ ;;
+'stop')
+ pureftpd_stop
+ ;;
+'restart')
+ pureftpd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac