Browse Source

x230: external_install_top.sh: add input file selection if -i is omitted

pull/35/head
Martin Kepplinger 6 years ago
parent
commit
07e7bdc410
1 changed files with 24 additions and 4 deletions
  1. +24
    -4
      x230/external_install_top.sh

+ 24
- 4
x230/external_install_top.sh View File

@ -76,10 +76,30 @@ do
done done
if [ ! "$have_input_image" -gt 0 ] ; then if [ ! "$have_input_image" -gt 0 ] ; then
echo "Image file to flash is needed. Please add -i <file>"
echo ""
usage
exit 1
image_available=$(ls -1 | grep x230_coreboot_seabios | grep rom)
if [ -z "${image_available}" ] ; then
echo "No image file found. Please add -i <file>"
echo ""
usage
exit 1
fi
prompt="file not specified. Please select a file to flash:"
options=( $(find -maxdepth 1 -name x230_coreboot_seabios*rom -print0 | xargs -0) )
PS3="$prompt "
select INPUT_IMAGE_PATH in "${options[@]}" "Quit" ; do
if (( REPLY == 1 + ${#options[@]} )) ; then
exit
elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
echo "You picked $INPUT_IMAGE_PATH which is file $REPLY"
break
else
echo "Invalid option. Try another one."
fi
done
fi fi
if [ ! "$have_flasher" -gt 0 ] ; then if [ ! "$have_flasher" -gt 0 ] ; then


Loading…
Cancel
Save