Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 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 | |
| 11 | DAEMON=/usr/sbin/vsftpd |
| 12 | NAME=vsftpd |
| 13 | DESC="FTP Server" |
| 14 | ARGS="" |
| 15 | FTPDIR=/var/lib/ftp |
| 16 | |
| 17 | test -f $DAEMON || exit 0 |
| 18 | |
| 19 | set -e |
| 20 | |
| 21 | case "$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 | ;; |
| 48 | esac |
| 49 | |
| 50 | exit 0 |