Commit c113ed8e authored by Natanael Copa's avatar Natanael Copa

setup-apkrepos: add -f for just-add-fastest mirror

fixes #4017
parent b0b109a0
......@@ -137,11 +137,12 @@ edit_repositories() {
usage() {
cat <<__EOF__
usage: setup-apkrepos [-hr] [REPO...]
usage: setup-apkrepos [-fhr] [REPO...]
Setup apk repositories
options:
-f Detect and add fastest mirror
-h Show this help
-r Add a random mirror and do not prompt
__EOF__
......@@ -149,8 +150,9 @@ __EOF__
}
while getopts "hr" opt; do
while getopts "fhr" opt; do
case $opt in
f) JUSTADDFASTEST=1;;
h) usage;;
r) JUSTADDRANDOM=1;;
esac
......@@ -193,6 +195,11 @@ if [ -n "$JUSTADDRANDOM" ]; then
add_random_mirror && changed=true
fi
if [ -n "$JUSTADDFASTEST" ]; then
show_mirror_list > /dev/null
add_fastest_mirror && changed=true
fi
while ! $changed; do
show_mirror_list
prompt_setup_method $default_answer
......
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