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

Generated by cgit