Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo check v2.0 #2687

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions menu/startup_configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ else
fi

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

case "$choice" in
*"Keyboard Layout"*)
Expand Down