1#!/bin/sh 2### BEGIN INIT INFO 3# Provides: vsftpd 4# Default-Start: 2345 5# Default-Stop: 016 6# Short-Description: Very Secure Ftp Daemon 7# Description: vsftpd is a Very Secure FTP daemon. It was written completely from 8# scratch 9### END INIT INFO 10 11DAEMON=/usr/sbin/vsftpd 12NAME=vsftpd 13DESC="FTP Server" 14ARGS="" 15FTPDIR=/var/lib/ftp 16 17test -f $DAEMON || exit 0 18 19set -e 20 21case "$1" in 22 start) 23 echo -n "* starting $DESC: $NAME... " 24 if ! test -d $FTPDIR; then 25 mkdir -p $FTPDIR/in 26 chown ftp $FTPDIR -R 27 chmod a-w $FTPDIR 28 chmod u+w $FTPDIR/in 29 fi 30 start-stop-daemon -S -b -x $DAEMON -- $ARGS 31 echo "done." 32 ;; 33 stop) 34 echo -n "* stopping $DESC: $NAME... " 35 start-stop-daemon -K -x $DAEMON 36 echo "done." 37 ;; 38 restart) 39 echo "* restarting $DESC: $NAME... " 40 $0 stop 41 $0 start 42 echo "done." 43 ;; 44 *) 45 echo "Usage: $0 {start|stop|restart}" 46 exit 1 47 ;; 48esac 49 50exit 0 51