]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[contrib] Allow "cow" script to create the SAN device itself
authorMichael Brown <mcb30@ipxe.org>
Wed, 22 Sep 2010 15:40:06 +0000 (16:40 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 22 Sep 2010 15:40:06 +0000 (16:40 +0100)
Allow for an invocation pattern such as:

  ./cow /path/to/image/file vblade 1 2 eth0

Signed-off-by: Michael Brown <mcb30@ipxe.org>
contrib/vm/cow

index 4abb8b82af47f8e6993e7376ac56f4421ef2a2d7..054ffdde923c00332699b73e3c72101e79e4747d 100755 (executable)
@@ -19,9 +19,10 @@ function cleanup () {
 
 trap cleanup EXIT
 
-imgfile=$1
-if [ -z "$imgfile" ] ; then
-    echo Syntax: $0 /path/to/image/file
+imgfile=$1 ; shift
+command=$1 ; shift
+if [ -z "$imgfile" -o -z "$command" ] ; then
+    echo Syntax: $0 /path/to/image/file command [args..]
     exit 1
 fi
 
@@ -45,4 +46,4 @@ x=$imgfile.cow ; ln -s /dev/mapper/$dmname $x ; cowlink=$x
 
 # Wait until killed
 echo "Created $cowlink"
-while : ; do sleep 2147483647 ; done
+$command "$@" $cowlink