1-get-initial-setup-working #2
							
								
								
									
										21
									
								
								setup.sh
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								setup.sh
									
									
									
									
									
								
							| @@ -125,25 +125,8 @@ function select_part () { | |||||||
|     if we_have_exactly_one_part "${part_type}" "${parts}"; then |     if we_have_exactly_one_part "${part_type}" "${parts}"; then | ||||||
|         part="${parts}" |         part="${parts}" | ||||||
|     else |     else | ||||||
|         if [[ "${part_type}" == 'zfs' ]]; then |         2> printf -- '%s\n' 'More than one '"${part_type^^}"' partition to pick for installation. Cowardly exiting ...' | ||||||
|             2> printf -- '%s\n' 'We have more than one ZFS (BF00) partition to pick for installation. Cowardly exiting ...' |         exit 77 | ||||||
|             exit 77 |  | ||||||
|         fi |  | ||||||
|         printf -- '%s\n' 'Which '"${part_type^^}"' partition do you want us to use?' |  | ||||||
|         while IFS= read -r found_part; do |  | ||||||
|             enriched_parts+=("'${found_part}'"' (aka ID '"'$(get_drive_id "${found_part}")'"')') |  | ||||||
|         done <<<"${parts}" |  | ||||||
|         enriched_parts_count="${#enriched_parts[@]}" |  | ||||||
|         select part in "${enriched_parts[@]}"; do |  | ||||||
|             part_number="${REPLY}" |  | ||||||
|             if [[ "${part_number}" -le "${enriched_parts_count}" ]]; then |  | ||||||
|                 part="$(sed "${REPLY}q;d" <<<"${parts}")" |  | ||||||
|                 printf -- '%s\n' 'You'"'"'ve selected '"'${part}'"' ...' |  | ||||||
|                 break |  | ||||||
|             else |  | ||||||
|                 printf -- '%s\n' 'Invalid option, please choose between 1 and '"${enriched_parts_count}" |  | ||||||
|             fi |  | ||||||
|         done |  | ||||||
|     fi |     fi | ||||||
|     printf -- '%s' "${part}" |     printf -- '%s' "${part}" | ||||||
|     return 0 |     return 0 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user