From 2f788e3a92f4a36bf0a0114ea9ac80887dc541dd Mon Sep 17 00:00:00 2001 From: Philip Hands Date: Mon, 13 Jun 2016 21:14:38 +0200 Subject: lvc: hack to allow use of local images (FIXME for pb10) Signed-off-by: Holger Levsen --- bin/lvc.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/lvc.sh b/bin/lvc.sh index 526d7e9e..88dc3cc0 100755 --- a/bin/lvc.sh +++ b/bin/lvc.sh @@ -24,6 +24,11 @@ cleanup_all() { fetch_if_newer() { url="$2" file="$1" + if [ -f $url ] ; then + echo "the URL turns out to be a local path ($url) -- linking" + ln -sf $url $file + return + fi echo "Downloading $url" curlopts="-L -s -S" if [ -f "$file" ] ; then @@ -91,7 +96,7 @@ elif [ ! -z "$IMAGE" ] ; then # fetch_if_newer "$IMAGE" "$URL" # is this really an .iso? - if [ $(file "$IMAGE" | grep -cE '(ISO 9660|DOS/MBR boot sector)') -eq 1 ] ; then + if [ $(file -L "$IMAGE" | grep -cE '(ISO 9660|DOS/MBR boot sector)') -eq 1 ] ; then # yes, so let's md5sum and mount it md5sum $IMAGE # sudo mkdir -p $IMAGE_MNT -- cgit v1.2.3-54-g00ecf