#! /bin/sh


case "$1" in

    start)
	getcfg ftp_enable
        if [ "$?" != "1" ]; then
                echo "FTP  disable"
                exit 0
        fi
	echo "ftp server on"
	/sbin/bftpd -d
	;;

    stop)
	echo "ftp server down"
	
	killall -9 bftpd
	if [ "$?" = "0" ]; then echo "Done"
	else                    echo "FAILED"; fi
	
	;;

    restart)
    	$0 stop
	sleep 1
	$0 start
	;;

    *)
	echo "Usage: $0 (start|stop|restart)"
	exit 1
	;;

esac

exit 0

