mirror of
https://github.com/dockur/windows.git
synced 2026-08-04 04:57:13 +01:00
Update answer.sh
This commit is contained in:
+9
-4
@@ -1387,12 +1387,17 @@ updateDiskID() {
|
|||||||
current="$ids"
|
current="$ids"
|
||||||
[ "$current" = "$target" ] && return 0
|
[ "$current" = "$target" ] && return 0
|
||||||
|
|
||||||
if [ "$current" != "1" ]; then
|
case "$current" in
|
||||||
error "The answer file must use DiskID 1 as its template value: $asset"
|
"0" | "1" ) ;;
|
||||||
|
* )
|
||||||
|
error "Unsupported DiskID $current in answer file: $asset"
|
||||||
return 1
|
return 1
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if ! sed -i 's#<DiskID>1</DiskID>#<DiskID>0</DiskID>#g' "$asset"; then
|
if ! sed -i -E \
|
||||||
|
"s#<DiskID>[[:space:]]*$current[[:space:]]*</DiskID>#<DiskID>$target</DiskID>#g" \
|
||||||
|
"$asset"; then
|
||||||
error "Failed to update DiskID in answer file: $asset"
|
error "Failed to update DiskID in answer file: $asset"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user