@@ -201,7 +201,7 @@ abortInstall() {
201
201
[[ " ${iso,,} " == * " .esd" ]] && exit 60
202
202
[[ " ${UNPACK:- } " == [Yy1]* ]] && exit 60
203
203
204
- efi=$( find " $dir " -maxdepth 1 -type d -iname efi | head -n 1 )
204
+ efi=$( find " $dir " -maxdepth 1 -type d -iname efi -print -quit )
205
205
206
206
if [ -z " $efi " ]; then
207
207
[[ " ${PLATFORM,,} " == " x64" ]] && BOOT_MODE=" windows_legacy"
@@ -230,17 +230,17 @@ detectCustom() {
230
230
231
231
CUSTOM=" "
232
232
233
- dir=$( find / -maxdepth 1 -type d -iname " $fname " | head -n 1 )
234
- [ ! -d " $dir " ] && dir=$( find " $STORAGE " -maxdepth 1 -type d -iname " $fname " | head -n 1 )
233
+ dir=$( find / -maxdepth 1 -type d -iname " $fname " -print -quit )
234
+ [ ! -d " $dir " ] && dir=$( find " $STORAGE " -maxdepth 1 -type d -iname " $fname " -print -quit )
235
235
236
236
if [ -d " $dir " ]; then
237
237
if ! hasDisk || [ ! -f " $boot " ]; then
238
238
error " The bind $dir maps to a file that does not exist!" && return 1
239
239
fi
240
240
fi
241
241
242
- file=$( find / -maxdepth 1 -type f -iname " $fname " | head -n 1 )
243
- [ ! -s " $file " ] && file=$( find " $STORAGE " -maxdepth 1 -type f -iname " $fname " | head -n 1 )
242
+ file=$( find / -maxdepth 1 -type f -iname " $fname " -print -quit )
243
+ [ ! -s " $file " ] && file=$( find " $STORAGE " -maxdepth 1 -type f -iname " $fname " -print -quit )
244
244
245
245
if [ ! -s " $file " ] && [[ " ${VERSION,,} " != " http" * ]]; then
246
246
base=$( basename " $VERSION " )
@@ -396,7 +396,7 @@ extractImage() {
396
396
397
397
else
398
398
399
- file=$( find " $dir " -maxdepth 1 -type f -iname " *.iso" | head -n 1 )
399
+ file=$( find " $dir " -maxdepth 1 -type f -iname " *.iso" -print -quit )
400
400
401
401
if [ -z " $file " ]; then
402
402
error " Failed to find any .iso file in archive!" && return 1
@@ -591,14 +591,14 @@ detectImage() {
591
591
fi
592
592
593
593
local src wim info
594
- src=$( find " $dir " -maxdepth 1 -type d -iname sources | head -n 1 )
594
+ src=$( find " $dir " -maxdepth 1 -type d -iname sources -print -quit )
595
595
596
596
if [ ! -d " $src " ]; then
597
597
warn " failed to locate 'sources' folder in ISO image, $FB " && return 1
598
598
fi
599
599
600
- wim=$( find " $src " -maxdepth 1 -type f -iname install.wim | head -n 1 )
601
- [ ! -f " $wim " ] && wim=$( find " $src " -maxdepth 1 -type f -iname install.esd | head -n 1 )
600
+ wim=$( find " $src " -maxdepth 1 -type f -iname install.wim -print -quit )
601
+ [ ! -f " $wim " ] && wim=$( find " $src " -maxdepth 1 -type f -iname install.esd -print -quit )
602
602
603
603
if [ ! -f " $wim " ]; then
604
604
warn " failed to locate 'install.wim' or 'install.esd' in ISO image, $FB " && return 1
@@ -723,8 +723,7 @@ updateXML() {
723
723
sed -i " s/<Username>Docker<\/Username>/<Username>$user <\/Username>/g" " $asset "
724
724
fi
725
725
726
- [ -n " $PASSWORD " ] && pass=" $PASSWORD " || pass=" "
727
- [ -z " $pass " ] && pass=" admin"
726
+ [ -n " $PASSWORD " ] && pass=" $PASSWORD " || pass=" admin"
728
727
729
728
pw=$( printf ' %s' " ${pass} Password" | iconv -f utf-8 -t utf-16le | base64 -w 0)
730
729
admin=$( printf ' %s' " ${pass} AdministratorPassword" | iconv -f utf-8 -t utf-16le | base64 -w 0)
@@ -893,14 +892,14 @@ updateImage() {
893
892
rm -rf " $tmp "
894
893
mkdir -p " $tmp "
895
894
896
- src=$( find " $dir " -maxdepth 1 -type d -iname sources | head -n 1 )
895
+ src=$( find " $dir " -maxdepth 1 -type d -iname sources -print -quit )
897
896
898
897
if [ ! -d " $src " ]; then
899
898
error " failed to locate 'sources' folder in ISO image, $FB " && return 1
900
899
fi
901
900
902
- wim=$( find " $src " -maxdepth 1 -type f -iname boot.wim | head -n 1 )
903
- [ ! -f " $wim " ] && wim=$( find " $src " -maxdepth 1 -type f -iname boot.esd | head -n 1 )
901
+ wim=$( find " $src " -maxdepth 1 -type f -iname boot.wim -print -quit )
902
+ [ ! -f " $wim " ] && wim=$( find " $src " -maxdepth 1 -type f -iname boot.esd -print -quit )
904
903
905
904
if [ ! -f " $wim " ]; then
906
905
error " failed to locate 'boot.wim' or 'boot.esd' in ISO image, $FB " && return 1
@@ -963,7 +962,7 @@ updateImage() {
963
962
964
963
local find=" $file "
965
964
[[ " $MANUAL " == [Yy1]* ]] && find=" $org "
966
- path=$( find " $dir " -maxdepth 1 -type f -iname " $find " | head -n 1 )
965
+ path=$( find " $dir " -maxdepth 1 -type f -iname " $find " -print -quit )
967
966
968
967
if [ -f " $path " ]; then
969
968
if [[ " $MANUAL " != [Yy1]* ]]; then
0 commit comments