diff options
author | Thomas Penteker <tek@serverop.de> | 2012-06-01 20:59:42 +0200 |
---|---|---|
committer | Thomas Penteker <tek@serverop.de> | 2012-06-01 20:59:42 +0200 |
commit | e88e8d9fdbf5b9bdb37c5cfb90cdf5c939eee019 (patch) | |
tree | 0dce0fddbd523d9505e6657c1243bc7098ef0052 /nbd/nbd-server | |
parent | 2e5b19ff05cd69b953f08e86c5752f6f9fa58f9e (diff) | |
download | contrib-e88e8d9fdbf5b9bdb37c5cfb90cdf5c939eee019.tar.gz contrib-e88e8d9fdbf5b9bdb37c5cfb90cdf5c939eee019.tar.xz |
nbd: initial import
Diffstat (limited to 'nbd/nbd-server')
-rwxr-xr-x | nbd/nbd-server | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/nbd/nbd-server b/nbd/nbd-server new file mode 100755 index 000000000..2aa36286c --- /dev/null +++ b/nbd/nbd-server @@ -0,0 +1,28 @@ +#!/bin/sh +# +# /etc/rc.d/nbd-server: start/stop nbd daemon +# + +case $1 in +start) + /usr/bin/nbd-server -p /var/run/nbd-server.pid -l /etc/nbd-server/allow + ;; +stop) + if [ -f /var/run/nbd-server.pid ]; then + kill `cat /var/run/nbd-server.pid` + rm -f /var/run/nbd-server.pid + else + killall -q /usr/sbin/nbd-server + fi + ;; +restart) + $0 stop + sleep 2 + $0 start + ;; +*) + echo "usage: $0 [start|stop|restart]" + ;; +esac + +# End of file |