summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-02-28 19:50:49 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-02-28 19:50:49 +0000
commit40e4d11f385a6e4d9672e57f14c6b9c1a0f918a8 (patch)
treebce48104b06cf78d4e329ee51a160eff44b72363
parent34f522070a0b0e0460ecc02207aa7cc94d0becc6 (diff)
downloadalpine-conf-40e4d11f385a6e4d9672e57f14c6b9c1a0f918a8.tar.bz2
alpine-conf-40e4d11f385a6e4d9672e57f14c6b9c1a0f918a8.tar.xz
setup-apkrepos: use chars instead of numbers. avoid ==
Use case ... in instead of if ... elif ...
-rwxr-xr-xsetup-apkrepos.in34
1 files changed, 15 insertions, 19 deletions
diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index 3719bdb..46d6a3b 100755
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -16,17 +16,16 @@ APKREPOS=`cat "$APKREPOS_PATH"`
prompt_setup_method() {
while true; do
- echo -e "\n1) Automatically pick a random mirror"
- echo -e "2) Automatically pick the fastest mirror (must be connected)"
- echo -e "3) Manually pick mirror from list"
- echo -e "4) Manually enter local/remote mirror(s)"
- echo -en "\nPlease select how to setup APK repositories [1]: "
- default_read setup_method 1
+ echo "How would you like to set up internet apk repositories?"
+ echo -e "r) Automatically pick a random mirror"
+ echo -e "f) Automatically pick the fastest mirror (must be connected)"
+ echo -e "l) Manually pick mirror from list"
+ echo -e "e) Manually enter local/remote mirror(s)"
+ 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
- 1) setup_method="random"; break;;
- 2) setup_method="fastest"; break;;
- 3) setup_method="mirror_list"; break;;
- 4) setup_method="custom_mirror"; break;;
+ r|f|l|e|n) break;;
esac
done
}
@@ -319,15 +318,12 @@ prompt_update_apk() {
# main
prompt_setup_method
-if [ "$setup_method" == "random" ]; then
- get_random_mirror
-elif [ "$setup_method" == "fastest" ]; then
- get_fastest_mirror
-elif [ "$setup_method" == "mirror_list" ]; then
- prompt_mirror_list
-elif [ "$setup_method" == "custom_mirror" ]; then
- prompt_clear_repositories # calls prompt_custom_mirror
-fi
+case "$setup_method" in
+ r) get_random_mirror;;
+ f) get_fastest_mirror;;
+ l) prompt_mirror_list;;
+ e) prompt_clear_repositories;;
+esac
if [ "$setup_method" != "custom_mirror" ]; then
# It doesn't make sense to run get_alpine_release for custom_mirror