Skip to content

Commit 0ff6cd3

Browse files
authored
further improvments to startup menu
1 parent da6baee commit 0ff6cd3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

menu/startup_configuration.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ else
3434
fi
3535

3636
# Get the correct apt-mirror
37+
# Handle several sources
38+
FIND_SOURCES="$(find /etc/apt/ -type f -name "*sources*")"
39+
for source in $FIND_SOURCES
40+
do
41+
REPO=$(grep "URIs:" "$source" | grep http | awk '{print $2}' | head -1)
42+
done
43+
# Check if it matches
3744
if [ "$REPO" = 'http://archive.ubuntu.com/ubuntu' ]
3845
then
3946
MIRROR_SWITCH="ON"
@@ -45,7 +52,7 @@ fi
4552
if [ -f "$SCRIPTS/wordpress-startup-script.sh" ]
4653
then
4754
msg_box "Running a server, it's important that certain things are correct.
48-
In the following menu you will be asked to setup the most basic stuff of your server.
55+
In the following menu you will be asked to set up the most basic stuff of your server.
4956
5057
The script is smart, and have already pre-selected the values that you'd want to change based on the current settings."
5158
fi
@@ -56,7 +63,7 @@ choice=$(whiptail --title "$TITLE" --checklist \
5663
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
5764
"Keyboard Layout" "(Change the keyboard layout from '$KEYBOARD_LAYOUT')" "$KEYBOARD_LAYOUT_SWITCH" \
5865
"Timezone" "(Change the timezone from $(cat /etc/timezone))" "$TIMEZONE_SWITCH" \
59-
"Locate Mirror" "(Change the apt-mirror from $REPO)" OFF 3>&1 1>&2 2>&3)
66+
"Locate Mirror" "(Change the apt repo for better download performance)" "$MIRROR_SWITCH" 3>&1 1>&2 2>&3)
6067

6168
case "$choice" in
6269
*"Keyboard Layout"*)

0 commit comments

Comments
 (0)