Allow for an invocation pattern such as:
./cow /path/to/image/file vblade 1 2 eth0
Signed-off-by: Michael Brown <mcb30@ipxe.org>
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
# Wait until killed
echo "Created $cowlink"
-while : ; do sleep 2147483647 ; done
+$command "$@" $cowlink