automatically detect country code

This commit is contained in:
Daniel Hansson 2018-09-20 18:33:58 +02:00 committed by GitHub
parent 6b6da700f3
commit 2f98dac13f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,33 +173,6 @@ fi
is_process_running apt
is_process_running dpkg
# Check where the best mirrors are and update
msg_box "To make downloads as fast as possible when updating you should have mirrors that are as close to you as possible.
This VM comes with mirrors based on servers in that where used when the VM was released and packaged.
If you are located outside of Europe, we recomend you to change the mirrors so that downloads are faster."
echo "Checking current mirror..."
printf "Your current server repository is: ${Cyan}$REPO${Color_Off}\n"
if [[ "no" == $(ask_yes_or_no "Do you want to try to find a better mirror?") ]]
then
echo "Keeping $REPO as mirror..."
sleep 1
else
echo "Locating the best mirrors..."
apt update -q4 & spinner_loading
apt install python-pip -y
pip install \
--upgrade pip \
apt-select
apt-select -m up-to-date -t 5 -c
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup && \
if [ -f sources.list ]
then
sudo mv sources.list /etc/apt/
fi
fi
echo
echo "Getting scripts from GitHub to be able to run the first setup..."
# All the shell scripts in static (.sh)
@ -248,6 +221,7 @@ It will also do the following:
- Set new passwords to Linux and Nextcloud
- Set new keyboard layout
- Change timezone
- Change mirrors depending on your location
- Set correct Rewriterules for Nextcloud
- Copy content from .htaccess to .user.ini (because we use php-fpm)
- Add additional options if you choose them
@ -282,6 +256,34 @@ else
clear
fi
# Check where the best mirrors are and update
msg_box "To make downloads as fast as possible when updating you should have mirrors that are as close to you as possible.
This VM comes with mirrors based on servers in that where used when the VM was released and packaged.
If you are located outside of Europe, we recomend you to change the mirrors so that downloads are faster."
echo "Checking current mirror..."
printf "Your current server repository is: ${Cyan}$REPO${Color_Off}\n"
if [[ "no" == $(ask_yes_or_no "Do you want to try to find a better mirror?") ]]
then
echo "Keeping $REPO as mirror..."
sleep 1
else
echo "Locating the best mirrors..."
apt update -q4 & spinner_loading
apt install python-pip -y
pip install \
--upgrade pip \
apt-select
check_command apt-select -m up-to-date -t 5 -c -C "$(localectl status | grep "Layout" | awk '{print $3}')"
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup && \
if [ -f sources.list ]
then
sudo mv sources.list /etc/apt/
fi
fi
clear
# Pretty URLs
echo "Setting RewriteBase to \"/\" in config.php..."
chown -R www-data:www-data $NCPATH