summaryrefslogtreecommitdiff
path: root/pure-ftpd/pure-ftpd.rc
blob: 74d142075792eb0cebb913b4e0f084d9829d7fba (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/pure-ftpd: start/stop pure-ftpd daemon
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/sbin/pure-ftpd
    8 PID=/var/run/pure-ftpd.pid
    9 CRT=/etc/ssl/certs/pure-ftpd.pem
   10 
   11 OPTS="/etc/pure-ftpd.conf"
   12 
   13 case $1 in
   14 start)
   15 	if [ ! -s $CRT ]; then
   16 		/usr/bin/mksslcert $CRT $CRT
   17 	fi
   18 
   19 	$SSD --start --pidfile $PID --exec $PROG -- $OPTS
   20 	;;
   21 stop)
   22 	$SSD --stop --retry 10 --pidfile $PID
   23 	;;
   24 restart)
   25 	$0 stop
   26 	$0 start
   27 	;;
   28 status)
   29 	$SSD --status --pidfile $PID
   30 	case $? in
   31 	0) echo "$PROG is running with pid $(cat $PID)" ;;
   32 	1) echo "$PROG is not running but the pid file $PID exists" ;;
   33 	3) echo "$PROG is not running" ;;
   34 	4) echo "Unable to determine the program status" ;;
   35 	esac
   36 	;;
   37 *)
   38 	echo "usage: $0 [start|stop|restart|reload|status]"
   39 	;;
   40 esac
   41 
   42 # End of file

Generated by cgit