mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Hotplug scripts include certain bash-isms that are not supported under some distros' default shell (eg. Ubuntu 6.10's use of dash) Signed-off-by: Alastair Tse <atse@xensource.com>
28 lines
498 B
Bash
Executable File
28 lines
498 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Usage: block-enbd [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/nd*; 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
|