nbd-server 455 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. #
  3. # /etc/rc.d/init.d/nbd-server: start/stop nbd daemon
  4. #
  5. case $1 in
  6. start)
  7. /usr/bin/nbd-server -p /var/run/nbd-server.pid -l /etc/nbd-server/allow
  8. ;;
  9. stop)
  10. if [ -f /var/run/nbd-server.pid ]; then
  11. kill `cat /var/run/nbd-server.pid`
  12. rm -f /var/run/nbd-server.pid
  13. else
  14. killall -q /usr/sbin/nbd-server
  15. fi
  16. ;;
  17. restart)
  18. $0 stop
  19. sleep 2
  20. $0 start
  21. ;;
  22. *)
  23. echo "kullanim: $0 [start|stop|restart]"
  24. ;;
  25. esac
  26. # End of file