mirror of
https://github.com/akatsukiro/lsky-pro-install-script.git
synced 2025-06-08 05:53:04 +08:00
feat: 添加Sury, Remi, MariaDB 的中国镜像并启用
This commit is contained in:
parent
a055ec8943
commit
fa80d50690
20
install.sh
20
install.sh
@ -70,9 +70,15 @@ pre_check() {
|
|||||||
if [[ -z "${CN}" ]]; then
|
if [[ -z "${CN}" ]]; then
|
||||||
LSKYPRO_RELEASE_URL="https://github.com/lsky-org/lsky-pro/releases/download"
|
LSKYPRO_RELEASE_URL="https://github.com/lsky-org/lsky-pro/releases/download"
|
||||||
LSKY_VERSION=$(curl -s "https://api.github.com/repos/lsky-org/lsky-pro/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
LSKY_VERSION=$(curl -s "https://api.github.com/repos/lsky-org/lsky-pro/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||||
|
SURY_PACKAGE_URL="https://packages.sury.org"
|
||||||
|
REMI_RPMS_URL="https://rpms.remirepo.net"
|
||||||
|
MARIADB_PACKAGE_URL="https://mirrors.xtom.com/mariadb"
|
||||||
else
|
else
|
||||||
LSKYPRO_RELEASE_URL="https://mirror.ghproxy.com/https://github.com/lsky-org/lsky-pro/releases/download"
|
LSKYPRO_RELEASE_URL="https://mirror.ghproxy.com/https://github.com/lsky-org/lsky-pro/releases/download"
|
||||||
LSKY_VERSION=$(curl -s "https://api.github.com/repos/lsky-org/lsky-pro/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
LSKY_VERSION=$(curl -s "https://api.github.com/repos/lsky-org/lsky-pro/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||||
|
SURY_PACKAGE_URL="https://mirror.nju.edu.cn/sury"
|
||||||
|
REMI_RPMS_URL="https://mirrors.aliyun.com/remi"
|
||||||
|
MARIADB_PACKAGE_URL="https://mirrors.aliyun.com/mariadb"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,12 +103,12 @@ install_php() {
|
|||||||
echo "默认安装php8.1"
|
echo "默认安装php8.1"
|
||||||
# add repo
|
# add repo
|
||||||
if [[ $systemFlag == "1" ]]; then
|
if [[ $systemFlag == "1" ]]; then
|
||||||
wget -O /usr/share/keyrings/php.gpg https://packages.sury.org/php/apt.gpg
|
wget -O /usr/share/keyrings/php.gpg ${SURY_PACKAGE_URL}/php/apt.gpg
|
||||||
echo "deb [signed-by=/usr/share/keyrings/php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
|
echo "deb [signed-by=/usr/share/keyrings/php.gpg] ${SURY_PACKAGE_URL}/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
|
||||||
elif [[ $systemFlag == "2" ]]; then
|
elif [[ $systemFlag == "2" ]]; then
|
||||||
add-apt-repository ppa:ondrej/php
|
add-apt-repository ppa:ondrej/php
|
||||||
elif [[ $systemFlag == "3" ]]; then
|
elif [[ $systemFlag == "3" ]]; then
|
||||||
dnf install https://rpms.remirepo.net/enterprise/remi-release-${os_version}.rpm -y
|
dnf install ${REMI_RPMS_URL}/enterprise/remi-release-${os_version}.rpm -y
|
||||||
dnf module reset php -y
|
dnf module reset php -y
|
||||||
dnf module install php:remi-8.1 -y
|
dnf module install php:remi-8.1 -y
|
||||||
fi
|
fi
|
||||||
@ -127,8 +133,8 @@ install_php() {
|
|||||||
install_apache() {
|
install_apache() {
|
||||||
echo -e "${green}开始安装Apache${plain}"
|
echo -e "${green}开始安装Apache${plain}"
|
||||||
if [[ $systemFlag == "1" ]]; then
|
if [[ $systemFlag == "1" ]]; then
|
||||||
wget -O /usr/share/keyrings/apache2.gpg https://packages.sury.org/apache2/apt.gpg
|
wget -O /usr/share/keyrings/apache2.gpg ${SURY_PACKAGE_URL}/apache2/apt.gpg
|
||||||
echo "deb [signed-by=/usr/share/keyrings/apache2.gpg] https://packages.sury.org/apache2/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/apache2.list
|
echo "deb [signed-by=/usr/share/keyrings/apache2.gpg] ${SURY_PACKAGE_URL}/apache2/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/apache2.list
|
||||||
elif [[ $systemFlag == "2" ]]; then
|
elif [[ $systemFlag == "2" ]]; then
|
||||||
add-apt-repository ppa:ondrej/apache2
|
add-apt-repository ppa:ondrej/apache2
|
||||||
fi
|
fi
|
||||||
@ -161,12 +167,12 @@ install_maraidb() {
|
|||||||
echo -e "${green}开始安装MariaDB${plain}"
|
echo -e "${green}开始安装MariaDB${plain}"
|
||||||
if [[ $systemFlag == "1" && $os_version == "11" ]] || [[ $systemFlag == "2" ]]; then
|
if [[ $systemFlag == "1" && $os_version == "11" ]] || [[ $systemFlag == "2" ]]; then
|
||||||
curl -sSL https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor > /usr/share/keyrings/mariadb.gpg
|
curl -sSL https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor > /usr/share/keyrings/mariadb.gpg
|
||||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mariadb.gpg] https://mirror-cdn.xtom.com/mariadb/repo/10.6/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/mariadb.list
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mariadb.gpg] ${MARIADB_PACKAGE_URL}/repo/10.6/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/mariadb.list
|
||||||
apt update && apt install mariadb-server -y
|
apt update && apt install mariadb-server -y
|
||||||
elif [[ $systemFlag == "1" && $os_version == "12" ]]; then
|
elif [[ $systemFlag == "1" && $os_version == "12" ]]; then
|
||||||
apt update && apt install mariadb-server -y
|
apt update && apt install mariadb-server -y
|
||||||
elif [[ $systemFlag == "3" ]]; then
|
elif [[ $systemFlag == "3" ]]; then
|
||||||
dnf install https://mirror-cdn.xtom.com/mariadb/yum/10.6/centos/${os_version}/x86_64/mariadb-release-10.6-1.el8.noarch.rpm -y
|
dnf install ${MARIADB_PACKAGE_URL}/yum/10.6/centos/${os_version}/x86_64/mariadb-release-10.6-1.el8.noarch.rpm -y
|
||||||
dnf install MariaDB-server MariaDB-client -y
|
dnf install MariaDB-server MariaDB-client -y
|
||||||
fi
|
fi
|
||||||
read -e -r -p "是否快速配置MariaDB? [Y/n] 默认 Y(es)" input
|
read -e -r -p "是否快速配置MariaDB? [Y/n] 默认 Y(es)" input
|
||||||
|
Loading…
x
Reference in New Issue
Block a user