qubes-linux-template-builder/scripts_debian/proxy/files/etc/xen/scripts/block-nbd
Jason Mehring 0b341f4fb2 Moved qubes-extra-files to its own directory as a sub-template (proxy) as its only needed for proxies
Removed call from qubes_installation scripts for proxy files.  will now be added by sub-template
Renamed extra-whonix-files to files
Modifies functions.sh to allow for very short proxy names and custom directories that will be dist independent
2014-10-24 06:48:11 -04:00

28 lines
498 B
Bash
Executable File

#!/bin/bash
# Usage: block-nbd [bind server ctl_port |unbind node]
#
# The node argument to unbind is the name of the device node we are to
# unbind.
#
# This assumes you're running a correctly configured server at the other end!
dir=$(dirname "$0")
. "$dir/block-common.sh"
case "$command" in
add)
for dev in /dev/nbd*; do
if nbd-client $2 $3 $dev; then
write_dev $dev
exit 0
fi
done
exit 1
;;
remove)
nbd-client -d $2
exit 0
;;
esac