Commit 627a29ba authored by Natanael Copa's avatar Natanael Copa

setup-apkrepos: make show mirror list a separate function

parent 24691ac9
...@@ -92,6 +92,15 @@ get_fastest_mirror() { ...@@ -92,6 +92,15 @@ get_fastest_mirror() {
echo "using $(get_hostname_from_url $mirror)" echo "using $(get_hostname_from_url $mirror)"
} }
show_mirror_list() {
local mirror i=1
echo ""
for mirror in $MIRRORS; do
echo "$i) $(get_hostname_from_url $mirror)"
i=$(($i + 1))
done
}
prompt_mirror_list() { prompt_mirror_list() {
local i local i
local mirror_hostname local mirror_hostname
...@@ -99,13 +108,7 @@ prompt_mirror_list() { ...@@ -99,13 +108,7 @@ prompt_mirror_list() {
local mirror_count=$(count $MIRRORS) local mirror_count=$(count $MIRRORS)
while true; do while true; do
echo "" show_mirror_list
i=1
for mirror in $MIRRORS; do
echo "$i) $(get_hostname_from_url $mirror)"
i=$(($i + 1))
done
echo -en "\nPlease select a mirror from the above list: " echo -en "\nPlease select a mirror from the above list: "
read mirror_index read mirror_index
case $mirror_index in case $mirror_index in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment