diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-02 13:07:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-02 13:09:22 +0000 |
commit | 627a29ba5161354d8cf24a9f0d09e3b5823d5313 (patch) | |
tree | ef0749a2741fa9ab8b85c969b218e39b230608e2 /setup-apkrepos.in | |
parent | 24691ac93ae248e174fde2356d76998add08ec70 (diff) | |
download | alpine-conf-627a29ba5161354d8cf24a9f0d09e3b5823d5313.zip |
setup-apkrepos: make show mirror list a separate function
Diffstat (limited to 'setup-apkrepos.in')
-rwxr-xr-x | setup-apkrepos.in | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/setup-apkrepos.in b/setup-apkrepos.in index 6a7a59d..22f6387 100755 --- a/setup-apkrepos.in +++ b/setup-apkrepos.in @@ -92,6 +92,15 @@ get_fastest_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() { local i local mirror_hostname @@ -99,13 +108,7 @@ prompt_mirror_list() { local mirror_count=$(count $MIRRORS) while true; do - echo "" - i=1 - for mirror in $MIRRORS; do - echo "$i) $(get_hostname_from_url $mirror)" - i=$(($i + 1)) - done - + show_mirror_list echo -en "\nPlease select a mirror from the above list: " read mirror_index case $mirror_index in |