Commit 40e4d11f authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-apkrepos: use chars instead of numbers. avoid ==

Use case ... in instead of if ... elif ...
parent 34f52207
...@@ -16,17 +16,16 @@ APKREPOS=`cat "$APKREPOS_PATH"` ...@@ -16,17 +16,16 @@ APKREPOS=`cat "$APKREPOS_PATH"`
prompt_setup_method() { prompt_setup_method() {
while true; do while true; do
echo -e "\n1) Automatically pick a random mirror" echo "How would you like to set up internet apk repositories?"
echo -e "2) Automatically pick the fastest mirror (must be connected)" echo -e "r) Automatically pick a random mirror"
echo -e "3) Manually pick mirror from list" echo -e "f) Automatically pick the fastest mirror (must be connected)"
echo -e "4) Manually enter local/remote mirror(s)" echo -e "l) Manually pick mirror from list"
echo -en "\nPlease select how to setup APK repositories [1]: " echo -e "e) Manually enter local/remote mirror(s)"
default_read setup_method 1 echo -e "n) Do not configure internet apk repositories at all"
echo -en "\nPlease select how to setup APK repositories (r/f/l/e/n) [n]: "
default_read setup_method n
case "$setup_method" in case "$setup_method" in
1) setup_method="random"; break;; r|f|l|e|n) break;;
2) setup_method="fastest"; break;;
3) setup_method="mirror_list"; break;;
4) setup_method="custom_mirror"; break;;
esac esac
done done
} }
...@@ -319,15 +318,12 @@ prompt_update_apk() { ...@@ -319,15 +318,12 @@ prompt_update_apk() {
# main # main
prompt_setup_method prompt_setup_method
if [ "$setup_method" == "random" ]; then case "$setup_method" in
get_random_mirror r) get_random_mirror;;
elif [ "$setup_method" == "fastest" ]; then f) get_fastest_mirror;;
get_fastest_mirror l) prompt_mirror_list;;
elif [ "$setup_method" == "mirror_list" ]; then e) prompt_clear_repositories;;
prompt_mirror_list esac
elif [ "$setup_method" == "custom_mirror" ]; then
prompt_clear_repositories # calls prompt_custom_mirror
fi
if [ "$setup_method" != "custom_mirror" ]; then if [ "$setup_method" != "custom_mirror" ]; then
# It doesn't make sense to run get_alpine_release for custom_mirror # It doesn't make sense to run get_alpine_release for custom_mirror
......
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