Browse Source

[contrib] Allow "cow" script to create the SAN device itself

Allow for an invocation pattern such as:

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
d052efb254
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      contrib/vm/cow

+ 5
- 4
contrib/vm/cow View File

@@ -19,9 +19,10 @@ function cleanup () {
19 19
 
20 20
 trap cleanup EXIT
21 21
 
22
-imgfile=$1
23
-if [ -z "$imgfile" ] ; then
24
-    echo Syntax: $0 /path/to/image/file
22
+imgfile=$1 ; shift
23
+command=$1 ; shift
24
+if [ -z "$imgfile" -o -z "$command" ] ; then
25
+    echo Syntax: $0 /path/to/image/file command [args..]
25 26
     exit 1
26 27
 fi
27 28
 
@@ -45,4 +46,4 @@ x=$imgfile.cow ; ln -s /dev/mapper/$dmname $x ; cowlink=$x
45 46
 
46 47
 # Wait until killed
47 48
 echo "Created $cowlink"
48
-while : ; do sleep 2147483647 ; done
49
+$command "$@" $cowlink

Loading…
Cancel
Save