mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-12-16 23:30:40 +08:00
fix: Check if file exists
This commit is contained in:
@@ -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 [ -s "$STORAGE/$BASE.pat" ]; then
|
if [[ "${URL,,}" != "http"* ]]; then
|
||||||
URL="file://$STORAGE/$BASE.pat"
|
if [ -s "$STORAGE/$BASE.pat" ]; then
|
||||||
|
URL="file://$STORAGE/$BASE.pat"
|
||||||
|
else
|
||||||
|
error "File $STORAGE/$BASE.pat does not exist" && exit 65
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user