From: Michael Brown Date: Wed, 22 Sep 2010 15:40:06 +0000 (+0100) Subject: [contrib] Allow "cow" script to create the SAN device itself X-Git-Tag: v1.20.1~2493 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d052efb2546d05572f553946a16ccca42313b25a;p=thirdparty%2Fipxe.git [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 --- diff --git a/contrib/vm/cow b/contrib/vm/cow index 4abb8b82a..054ffdde9 100755 --- a/contrib/vm/cow +++ b/contrib/vm/cow @@ -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