mirror of
https://github.com/spiritLHLS/one-click-installation-script.git
synced 2024-11-16 09:12:19 +08:00
Update package.sh
This commit is contained in:
parent
7d9fa02750
commit
d71712777f
12
package.sh
12
package.sh
|
@ -41,8 +41,6 @@ change_debian_apt_sources() {
|
|||
cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
# Determine Debian version
|
||||
DEBIAN_VERSION=$(lsb_release -sr)
|
||||
# Get the current system version
|
||||
DEBIAN_VERSION=$(lsb_release -sr)
|
||||
|
||||
if [ "$location" = "China" ]; then
|
||||
# IP is in China, update apt sources
|
||||
|
@ -165,9 +163,16 @@ EOF
|
|||
|
||||
|
||||
change_ubuntu_apt_sources() {
|
||||
# Check if the IP is in China
|
||||
ip=$(curl -s https://ipapi.co/ip)
|
||||
location=$(curl -s https://ipapi.co/$ip/country_name)
|
||||
|
||||
# Check the system's Ubuntu version
|
||||
ubuntu_version=$(lsb_release -r | awk '{print $2}')
|
||||
|
||||
if [ "$location" = "China" ]; then
|
||||
# IP is in China, update apt sources
|
||||
echo "IP is in China, updating apt sources."
|
||||
else:
|
||||
if [ "$ubuntu_version" = "12.04" ]; then
|
||||
# Backup the current sources.list
|
||||
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
|
@ -218,6 +223,7 @@ change_ubuntu_apt_sources() {
|
|||
else
|
||||
echo "The system is not Ubuntu 12/14/16/18/20/22 . No changes were made to the apt sources."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
fix_broken() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user