Milis Linux 2.0 Git Deposu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
916B

  1. #! /bin/sh
  2. . /etc/rc.d/functions
  3. DESC="TFTP Service"
  4. NAME=tftpd
  5. DAEMON=/usr/bin/in.tftpd
  6. DAEMON_ARGS="--listen "
  7. PIDFILE=/var/run/tftp/tftp.pid
  8. SCRIPTNAME=/etc/init.d/tftpd
  9. # Exit if the package is not installed
  10. [ -x "$DAEMON" ] || exit 0
  11. [ -f /etc/tftpd.conf ] && . /etc/tftpd.conf
  12. [ ! -d /var/lib/tftpboot ] && install -d --group=nogroup --owner=nobody /var/lib/tftpboot
  13. case "$1" in
  14. start)
  15. log_info_msg "Starting $DESC"
  16. start_daemon -p "${PIDFILE}" ${DAEMON} ${DAEMON_ARGS} ${TFTPD_ARGS}
  17. evaluate_retval
  18. ;;
  19. stop)
  20. log_info_msg "Stopping $DESC: $NAME"
  21. killproc -p "${PIDFILE}" ${DAEMON}
  22. evaluate_retval
  23. ;;
  24. status)
  25. log_info_msg "Checking $DESC: "
  26. statusproc -p "${PIDFILE}" ${DAEMON}
  27. ;;
  28. restart)
  29. log_info_msg "Restarting $DESC: $NAME"
  30. $0 stop
  31. sleep 1
  32. $0 start
  33. ;;
  34. *)
  35. echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2
  36. exit 1
  37. ;;
  38. esac
  39. exit 0