mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-09 18:07:50 +08:00
fix: Check if file exists
This commit is contained in:
parent
f0ab26db30
commit
0c28ebd4ba
@ -18,8 +18,12 @@ if [ -n "$URL" ]; then
|
|||||||
: "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}"
|
: "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}"
|
||||||
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
|
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
|
||||||
fi
|
fi
|
||||||
|
if [[ "${URL,,}" != "http"* ]]; then
|
||||||
if [ -s "$STORAGE/$BASE.pat" ]; then
|
if [ -s "$STORAGE/$BASE.pat" ]; then
|
||||||
URL="file://$STORAGE/$BASE.pat"
|
URL="file://$STORAGE/$BASE.pat"
|
||||||
|
else
|
||||||
|
error "File $STORAGE/$BASE.pat does not exist" && exit 65
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user