diff --git a/setup-alpine.in b/setup-alpine.in index 952d7da521fdc3f6db2b982086f930dc926b778e..a8ec32804a77136b05f5e13d74ccad2a437af76c 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -222,7 +222,11 @@ if ! is_kvm_clock && [ "$rc_sys" != "LXC" ] && [ "$quick" != 1 ]; then setup-ntp ${NTPOPTS} fi -setup-apkrepos ${APKREPOSOPTS} +#Abort when mirror setup fails +if ! setup-apkrepos ${APKREPOSOPTS}; then + echo "Failed to setup apk repos aborting.." + exit 1 +fi # Now that network and apk are operational we can install another device manager if [ "$rc_sys" != LXC ] && [ -n "$DEVDOPTS" -a "$DEVDOPTS" != mdev ]; then diff --git a/setup-apkrepos.in b/setup-apkrepos.in index 504025ed2271b414a24f679f8b28d46f386ea8dc..4b1cbfdc38c516ebc915c8afce5a57d2b13593e6 100644 --- a/setup-apkrepos.in +++ b/setup-apkrepos.in @@ -170,7 +170,9 @@ done shift $(($OPTIND - 1)) if [ -z "$MIRRORS" ]; then - MIRRORS=$(wget -qO- $MIRRORS_URL) + if ! MIRRORS=$(wget -qO- $MIRRORS_URL); then + exit 1 + fi fi APKREPOS_PATH="${ROOT}"etc/apk/repositories @@ -206,10 +208,6 @@ if $add_fastest; then fi while ! $changed; do - if [ -z "$MIRRORS" ]; then - MIRRORS=$(wget -qO- $MIRRORS_URL) - fi - show_mirror_list ask_setup_method ${APKREPO_DEFAULT_ANSWER:-1}