]> git.pld-linux.org Git - packages/pure-ftpd.git/commitdiff
init.d script for pure-ftpd
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 26 Aug 2001 18:48:33 +0000 (18:48 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pure-ftpd.init -> 1.1

pure-ftpd.init [new file with mode: 0644]

diff --git a/pure-ftpd.init b/pure-ftpd.init
new file mode 100644 (file)
index 0000000..f7ff1ad
--- /dev/null
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# pureftpd     PureFTPD server
+#
+# chkconfig:   345 85 15
+# description: PureFTPD is fast, production-quality, standard-conformant FTP server
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/pure-ftpd ] && . /etc/sysconfig/pure-ftpd
+
+# Check that networking is up.
+if is_no "${NETWORKING}"; then
+        # nls "ERROR: Networking is down. %s can't be run." <service>
+        msg_Network_Down pure-ftpd
+        exit 1
+fi
+
+if [ -f /etc/ftpd/pureftpd.conf ]; then
+    PUREFTPD_OPTS=$(grep -E -v "^\W*#" /etc/ftpd/pureftpd.conf | xargs)
+fi
+
+if [ -f /etc/ftpd/pureftpd-mysql.conf ]; then
+    PUREFTPD_OPTS="${PUREFTPD_OPTS} -l /etc/ftpd/pureftpd-mysql.conf"
+fi
+
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+        if [ ! -f /var/lock/subsys/pure-ftpd ]; then
+               msg_starting pure-ftpd
+               daemon pure-ftpd $PUREFTPD_OPTS --daemonize
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd
+       else
+               msg_Already_Running pure-ftpd
+               exit 1
+       fi
+       ;;
+  stop)
+        # Stop daemons.
+       if [ -f /var/lock/subsys/pure-ftpd ]; then
+                msg_stopping pure-ftpd
+                killproc pure-ftpd
+                rm -f /var/lock/subsys/pure-ftpd > /dev/null 2>&1
+        else
+               msg_Not_Running pure-ftpd
+               exit 1
+       fi
+       ;;
+  status)
+       status pure-ftpd
+       RETVAL=$?
+       if [ $RETVAL -eq 0 ]; then
+           pure-ftpwho
+       fi
+       exit $RETVAL
+       ;;
+  restart|reload)
+       $0 stop
+       $0 start
+       ;;
+  *)
+       msg_Usage "$0 {start|stop|restart|status}"
+       exit 1
+       ;;
+esac
+
+exit $RETVAL
+
This page took 0.127751 seconds and 4 git commands to generate.