mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 19:35:49 +00:00
fix: Sanitize filename
This commit is contained in:
parent
8b93ea2fb5
commit
1ef8a9932b
1 changed files with 7 additions and 16 deletions
|
|
@ -48,10 +48,13 @@ fi
|
||||||
|
|
||||||
MSG="Please wait while Windows is being started..."
|
MSG="Please wait while Windows is being started..."
|
||||||
|
|
||||||
if [ ! -f "$STORAGE/custom.iso" ]; then
|
BASE="custom.iso"
|
||||||
|
if [ ! -f "$STORAGE/$BASE" ]; then
|
||||||
|
|
||||||
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
||||||
|
|
||||||
if [ ! -f "$STORAGE/$VERSION.iso" ]; then
|
BASE="$VERSION.iso"
|
||||||
|
if [ ! -f "$STORAGE/$BASE" ]; then
|
||||||
MSG="Please wait while Windows is being downloaded..."
|
MSG="Please wait while Windows is being downloaded..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -59,6 +62,8 @@ if [ ! -f "$STORAGE/custom.iso" ]; then
|
||||||
|
|
||||||
BASE=$(basename "$VERSION")
|
BASE=$(basename "$VERSION")
|
||||||
BASE="${BASE%%\?*}"
|
BASE="${BASE%%\?*}"
|
||||||
|
: "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}"
|
||||||
|
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
|
||||||
|
|
||||||
if [ ! -f "$STORAGE/$BASE" ]; then
|
if [ ! -f "$STORAGE/$BASE" ]; then
|
||||||
MSG="Please wait while '$BASE' is being downloaded..."
|
MSG="Please wait while '$BASE' is being downloaded..."
|
||||||
|
|
@ -70,20 +75,6 @@ fi
|
||||||
# Display wait message
|
# Display wait message
|
||||||
/run/server.sh "Windows" "$MSG" &
|
/run/server.sh "Windows" "$MSG" &
|
||||||
|
|
||||||
BASE="custom.iso"
|
|
||||||
[ -f "$STORAGE/$BASE" ] && return 0
|
|
||||||
|
|
||||||
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
|
||||||
|
|
||||||
BASE="$VERSION.iso"
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
BASE=$(basename "$VERSION")
|
|
||||||
BASE="${BASE%%\?*}"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f "$STORAGE/$BASE" ] && return 0
|
[ -f "$STORAGE/$BASE" ] && return 0
|
||||||
|
|
||||||
TMP="$STORAGE/tmp"
|
TMP="$STORAGE/tmp"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue