Commit 692d59d4 authored by Natanael Copa's avatar Natanael Copa

setup-apkrepos: mionor cleanup

use get_hostname_from_url function to make it more readable
parent a75f4297
......@@ -20,6 +20,11 @@ if [ -r "$APKREPOS_PATH" ]; then
APKREPOS=`cat "$APKREPOS_PATH"`
fi
get_hostname_from_url() {
local n=${1#*://}
echo ${n%%/*}
}
prompt_setup_method() {
while true; do
echo "How would you like to set up internet apk repositories?"
......@@ -50,9 +55,7 @@ get_random_mirror() {
i=`expr $i + 1`
done
random_mirror_hostname=`echo $mirror | awk -F '://' '{print $2}' | awk -F '/' '{print $1}'`
echo "using $random_mirror_hostname."
echo "using $(get_hostname_from_url $mirror)"
}
get_fastest_mirror() {
......@@ -90,11 +93,6 @@ get_fastest_mirror() {
mirror=$mirror_lowest_rtt_mirror
}
get_hostname_from_url() {
local n=${1#*://}
echo ${n%%/*}
}
prompt_mirror_list() {
local i
local mirror_hostname
......
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