mirror of
https://gitee.com/SuperManito/LinuxMirrors
synced 2025-11-08 10:20:27 +08:00
优化
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
## Author: SuperManito
|
## Author: SuperManito
|
||||||
## Modified: 2021-10-17
|
## Modified: 2021-10-24
|
||||||
## License: GPL-2.0
|
## License: GPL-2.0
|
||||||
## https://github.com/SuperManito/LinuxMirrors
|
## Github Repository: https://github.com/SuperManito/LinuxMirrors
|
||||||
## https://gitee.com/SuperManito/LinuxMirrors
|
## Gitee Repository: https://gitee.com/SuperManito/LinuxMirrors
|
||||||
|
|
||||||
function AuthorSignature() {
|
function AuthorSignature() {
|
||||||
if [ ${SYSTEM_FACTIONS} = ${SYSTEM_DEBIAN} ]; then
|
if [ ${SYSTEM_FACTIONS} = ${SYSTEM_DEBIAN} ]; then
|
||||||
@@ -26,7 +26,7 @@ function AuthorSignature() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## 定义系统判定变量
|
## 定义系统判定变量
|
||||||
DebianRelease=lsb_release
|
DebianRelease="lsb_release"
|
||||||
Arch=$(uname -m)
|
Arch=$(uname -m)
|
||||||
SYSTEM_DEBIAN="Debian"
|
SYSTEM_DEBIAN="Debian"
|
||||||
SYSTEM_UBUNTU="Ubuntu"
|
SYSTEM_UBUNTU="Ubuntu"
|
||||||
@@ -50,7 +50,7 @@ SelinuxConfig=/etc/selinux/config
|
|||||||
|
|
||||||
## 组合函数
|
## 组合函数
|
||||||
function Combin_Function() {
|
function Combin_Function() {
|
||||||
PermissionJudgment && clear
|
PermissionJudgment
|
||||||
EnvJudgment
|
EnvJudgment
|
||||||
ChooseMirrors
|
ChooseMirrors
|
||||||
BackupMirrors
|
BackupMirrors
|
||||||
@@ -78,6 +78,15 @@ function EnvJudgment() {
|
|||||||
## 判定系统名称、版本、版本号
|
## 判定系统名称、版本、版本号
|
||||||
case ${SYSTEM_FACTIONS} in
|
case ${SYSTEM_FACTIONS} in
|
||||||
Debian)
|
Debian)
|
||||||
|
if [ ! -x /usr/bin/lsb_release ]; then
|
||||||
|
apt-get install -y lsb-release
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
clear
|
||||||
|
else
|
||||||
|
echo -e '\n\033[31m -------- lsb-release 软件包安装失败 ------------ \033[0m'
|
||||||
|
echo -e "\n本脚本需要通过 lsb_release 指令判定系统类型,一般系统自带,当前可能为精简安装的系统,请自行安装!\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
SYSTEM_JUDGMENT=$(${DebianRelease} -is)
|
SYSTEM_JUDGMENT=$(${DebianRelease} -is)
|
||||||
SYSTEM_VERSION=$(${DebianRelease} -cs)
|
SYSTEM_VERSION=$(${DebianRelease} -cs)
|
||||||
;;
|
;;
|
||||||
@@ -352,7 +361,8 @@ function UpgradeSoftware() {
|
|||||||
## 更换基于 Debian 系 Linux 发行版的国内源
|
## 更换基于 Debian 系 Linux 发行版的国内源
|
||||||
function DebianMirrors() {
|
function DebianMirrors() {
|
||||||
## 修改国内源
|
## 修改国内源
|
||||||
if [ ${SYSTEM_JUDGMENT} = ${SYSTEM_UBUNTU} ]; then
|
case ${SYSTEM_JUDGMENT} in
|
||||||
|
Ubuntu)
|
||||||
echo "## 默认禁用源码镜像以提高速度,如需启用请自行取消注释
|
echo "## 默认禁用源码镜像以提高速度,如需启用请自行取消注释
|
||||||
deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main restricted universe multiverse
|
deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main restricted universe multiverse
|
||||||
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main restricted universe multiverse
|
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main restricted universe multiverse
|
||||||
@@ -366,7 +376,8 @@ deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION}-backports mai
|
|||||||
## 预发布软件源(不建议启用)
|
## 预发布软件源(不建议启用)
|
||||||
# deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION}-proposed main restricted universe multiverse
|
# deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION}-proposed main restricted universe multiverse
|
||||||
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION}-proposed main restricted universe multiverse" >>$DebianSourceList
|
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION}-proposed main restricted universe multiverse" >>$DebianSourceList
|
||||||
elif [ ${SYSTEM_JUDGMENT} = ${SYSTEM_DEBIAN} ]; then
|
;;
|
||||||
|
Debian)
|
||||||
echo "## 默认禁用源码镜像以提高速度,如需启用请自行取消注释
|
echo "## 默认禁用源码镜像以提高速度,如需启用请自行取消注释
|
||||||
deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main contrib non-free
|
deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main contrib non-free
|
||||||
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main contrib non-free
|
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main contrib non-free
|
||||||
@@ -378,10 +389,12 @@ deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION}-backports mai
|
|||||||
## 预发布软件源(不建议启用)
|
## 预发布软件源(不建议启用)
|
||||||
# deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}-security ${SYSTEM_VERSION}/updates main contrib non-free
|
# deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}-security ${SYSTEM_VERSION}/updates main contrib non-free
|
||||||
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}-security ${SYSTEM_VERSION}/updates main contrib non-free" >>$DebianSourceList
|
# deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH}-security ${SYSTEM_VERSION}/updates main contrib non-free" >>$DebianSourceList
|
||||||
elif [ ${SYSTEM_JUDGMENT} = ${SYSTEM_KALI} ]; then
|
;;
|
||||||
|
Kali)
|
||||||
echo "deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main non-free contrib
|
echo "deb ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main non-free contrib
|
||||||
deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main non-free contrib" >>$DebianSourceList
|
deb-src ${WEB_PROTOCOL}://${SOURCE}/${SOURCE_BRANCH} ${SYSTEM_VERSION} main non-free contrib" >>$DebianSourceList
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
## 更换基于 RedHat 系 Linux 发行版的国内源
|
## 更换基于 RedHat 系 Linux 发行版的国内源
|
||||||
@@ -454,6 +467,7 @@ function EPELMirrors() {
|
|||||||
|
|
||||||
## 选择国内源
|
## 选择国内源
|
||||||
function ChooseMirrors() {
|
function ChooseMirrors() {
|
||||||
|
clear
|
||||||
echo -e '+---------------------------------------------------+'
|
echo -e '+---------------------------------------------------+'
|
||||||
echo -e '| |'
|
echo -e '| |'
|
||||||
echo -e '| ============================================= |'
|
echo -e '| ============================================= |'
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
## Author: SuperManito
|
## Author: SuperManito
|
||||||
## Modified: 2021-10-17
|
## Modified: 2021-10-24
|
||||||
## License: GPL-2.0
|
## License: GPL-2.0
|
||||||
## https://github.com/SuperManito/LinuxMirrors
|
## Github Repository: https://github.com/SuperManito/LinuxMirrors
|
||||||
## https://gitee.com/SuperManito/LinuxMirrors
|
## Gitee Repository: https://gitee.com/SuperManito/LinuxMirrors
|
||||||
|
|
||||||
function AuthorSignature() {
|
function AuthorSignature() {
|
||||||
if [ ${SYSTEM_FACTIONS} = ${SYSTEM_DEBIAN} ]; then
|
if [ ${SYSTEM_FACTIONS} = ${SYSTEM_DEBIAN} ]; then
|
||||||
@@ -26,7 +26,7 @@ function AuthorSignature() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## 定义系统判定变量
|
## 定义系统判定变量
|
||||||
DebianRelease=lsb_release
|
DebianRelease="lsb_release"
|
||||||
Arch=$(uname -m)
|
Arch=$(uname -m)
|
||||||
SYSTEM_DEBIAN="Debian"
|
SYSTEM_DEBIAN="Debian"
|
||||||
SYSTEM_UBUNTU="Ubuntu"
|
SYSTEM_UBUNTU="Ubuntu"
|
||||||
@@ -62,7 +62,7 @@ DOCKER_COMPOSE_DOWNLOAD_URL=https://github.com/docker/compose/releases/download/
|
|||||||
## 组合函数
|
## 组合函数
|
||||||
function Combin_Function() {
|
function Combin_Function() {
|
||||||
PermissionJudgment
|
PermissionJudgment
|
||||||
NetWorkJudgment && clear
|
NetWorkJudgment
|
||||||
EnvJudgment
|
EnvJudgment
|
||||||
ChooseMirrors
|
ChooseMirrors
|
||||||
InstallationEnvironment
|
InstallationEnvironment
|
||||||
@@ -493,6 +493,7 @@ function ShowVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ChooseMirrors() {
|
function ChooseMirrors() {
|
||||||
|
clear
|
||||||
echo -e '+---------------------------------------------------+'
|
echo -e '+---------------------------------------------------+'
|
||||||
echo -e '| |'
|
echo -e '| |'
|
||||||
echo -e '| ============================================= |'
|
echo -e '| ============================================= |'
|
||||||
|
|||||||
Reference in New Issue
Block a user