Skip to content

Commit 2e93ab5

Browse files
authored
repo check v2.0 (#2687)
1 parent eea6c70 commit 2e93ab5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

menu/startup_configuration.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ else
3737
fi
3838

3939
# Get the correct apt-mirror
40-
REPO=$(grep "URIs:" "$(find /etc/apt/ -type f -name "*sources*")" | grep http | awk '{print $2}' | head -1)
40+
# Handle several sources
41+
FIND_SOURCES="$(find /etc/apt/ -type f -name "*sources*")"
42+
for source in $FIND_SOURCES
43+
do
44+
REPO=$(grep "URIs:" "$source" | grep http | awk '{print $2}' | head -1)
45+
done
46+
# Check if it matches
4147
if [ "$REPO" = 'http://archive.ubuntu.com/ubuntu' ]
4248
then
4349
MIRROR_SWITCH="ON"
@@ -60,7 +66,7 @@ choice=$(whiptail --title "$TITLE" --checklist \
6066
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
6167
"Keyboard Layout" "(Change the keyboard layout from '$KEYBOARD_LAYOUT')" "$KEYBOARD_LAYOUT_SWITCH" \
6268
"Timezone" "(Change the timezone from $(cat /etc/timezone))" "$TIMEZONE_SWITCH" \
63-
"Locate Mirror" "(Change the apt repo for better download performance)" OFF 3>&1 1>&2 2>&3)
69+
"Locate Mirror" "(Change the apt repo for better download performance)" "$MIRROR_SWITCH" 3>&1 1>&2 2>&3)
6470

6571
case "$choice" in
6672
*"Keyboard Layout"*)

0 commit comments

Comments
 (0)