This commit is contained in:
SuperManito
2023-05-25 06:44:54 +08:00
parent 371176c158
commit aaabd5d08c
2 changed files with 35 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## Author: SuperManito ## Author: SuperManito
## Modified: 2023-05-10 ## Modified: 2023-05-25
## License: MIT ## License: MIT
## Github: https://github.com/SuperManito/LinuxMirrors ## Github: https://github.com/SuperManito/LinuxMirrors
## Website: https://linuxmirrors.cn ## Website: https://linuxmirrors.cn
@@ -1466,7 +1466,7 @@ function ArchMirrors() {
## 生成 CentOS 官方 repo 源文件 ## 生成 CentOS 官方 repo 源文件
function GenRepoFiles_CentOS() { function GenRepoFiles_CentOS() {
case $1 in case "$1" in
8) 8)
cat >$Dir_YumRepos/CentOS-Linux-AppStream.repo <<\EOF cat >$Dir_YumRepos/CentOS-Linux-AppStream.repo <<\EOF
# CentOS-Linux-AppStream.repo # CentOS-Linux-AppStream.repo
@@ -1897,7 +1897,7 @@ EOF
## 生成 CentOS Stream 官方 repo 源文件 ## 生成 CentOS Stream 官方 repo 源文件
function GenRepoFiles_CentOSStream() { function GenRepoFiles_CentOSStream() {
case $1 in case "$1" in
9) 9)
cat >$Dir_YumRepos/centos.repo <<\EOF cat >$Dir_YumRepos/centos.repo <<\EOF
[baseos] [baseos]
@@ -2399,7 +2399,7 @@ EOF
## 生成 Rocky Linux 官方 repo 源文件 ## 生成 Rocky Linux 官方 repo 源文件
function GenRepoFiles_RockyLinux() { function GenRepoFiles_RockyLinux() {
case $1 in case "$1" in
9) 9)
cat >$Dir_YumRepos/rocky.repo <<\EOF cat >$Dir_YumRepos/rocky.repo <<\EOF
# rocky.repo # rocky.repo
@@ -3084,7 +3084,7 @@ EOF
## 生成 AlmaLinux 官方 repo 源文件 ## 生成 AlmaLinux 官方 repo 源文件
function GenRepoFiles_AlmaLinux() { function GenRepoFiles_AlmaLinux() {
case $1 in case "$1" in
9) 9)
cat >$Dir_YumRepos/almalinux-appstream.repo <<\EOF cat >$Dir_YumRepos/almalinux-appstream.repo <<\EOF
[appstream] [appstream]
@@ -4019,7 +4019,7 @@ EOF
## 生成 OpenCloudOS 官方 repo 源文件 ## 生成 OpenCloudOS 官方 repo 源文件
function GenRepoFiles_OpenCloudOS() { function GenRepoFiles_OpenCloudOS() {
case $1 in case "$1" in
9) 9)
cat >$Dir_YumRepos/OpenCloudOS.repo <<\EOF cat >$Dir_YumRepos/OpenCloudOS.repo <<\EOF
[BaseOS] [BaseOS]
@@ -4308,9 +4308,9 @@ EOF
## 生成 openSUSE 官方 repo 源文件 ## 生成 openSUSE 官方 repo 源文件
function GenRepoFiles_openSUSE() { function GenRepoFiles_openSUSE() {
case $1 in case "$1" in
"leap") "leap")
case $2 in case "$2" in
15.[0-2]) 15.[0-2])
cat >$Dir_openSUSERepos/repo-debug-non-oss.repo <<\EOF cat >$Dir_openSUSERepos/repo-debug-non-oss.repo <<\EOF
[repo-debug-non-oss] [repo-debug-non-oss]
@@ -4874,7 +4874,7 @@ function CommandOptions() {
## 判断参数 ## 判断参数
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case "$1" in
## 海外模式 ## 海外模式
--abroad) --abroad)
USE_ABROAD_SOURCE="true" USE_ABROAD_SOURCE="true"
@@ -4885,7 +4885,7 @@ function CommandOptions() {
;; ;;
## 指定软件源地址 ## 指定软件源地址
--source) --source)
if [ $2 ]; then if [ "$2" ]; then
echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!"
@@ -4898,7 +4898,7 @@ function CommandOptions() {
fi fi
;; ;;
--source-security) --source-security)
if [ $2 ]; then if [ "$2" ]; then
echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!"
@@ -4911,7 +4911,7 @@ function CommandOptions() {
fi fi
;; ;;
--source-vault) --source-vault)
if [ $2 ]; then if [ "$2" ]; then
echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!"
@@ -4925,7 +4925,7 @@ function CommandOptions() {
;; ;;
## 指定软件源分支 ## 指定软件源分支
--branch) --branch)
if [ $2 ]; then if [ "$2" ]; then
SOURCE_BRANCH="$2" SOURCE_BRANCH="$2"
shift shift
else else
@@ -4933,7 +4933,7 @@ function CommandOptions() {
fi fi
;; ;;
--branch-security) --branch-security)
if [ $2 ]; then if [ "$2" ]; then
SOURCE_BRANCH_SECURITY="$2" SOURCE_BRANCH_SECURITY="$2"
shift shift
else else
@@ -4941,7 +4941,7 @@ function CommandOptions() {
fi fi
;; ;;
--branch-vault) --branch-vault)
if [ $2 ]; then if [ "$2" ]; then
SOURCE_BRANCH_VAULT="$2" SOURCE_BRANCH_VAULT="$2"
shift shift
else else
@@ -4950,8 +4950,8 @@ function CommandOptions() {
;; ;;
## 优先使用内网地址 ## 优先使用内网地址
--intranet) --intranet)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
[Tt]rue | [Ff]alse) [Tt]rue | [Ff]alse)
USE_INTRANET_SOURCE="${2,,}" USE_INTRANET_SOURCE="${2,,}"
shift shift
@@ -4966,8 +4966,8 @@ function CommandOptions() {
;; ;;
## WEB 协议HTTP/HTTPS ## WEB 协议HTTP/HTTPS
--web-protocol) --web-protocol)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
http | https | HTTP | HTTPS) http | https | HTTP | HTTPS)
WEB_PROTOCOL="$2" WEB_PROTOCOL="$2"
shift shift
@@ -4982,8 +4982,8 @@ function CommandOptions() {
;; ;;
## 安装 EPEL 附加软件包 ## 安装 EPEL 附加软件包
--install-epel) --install-epel)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
[Tt]rue | [Ff]alse) [Tt]rue | [Ff]alse)
INSTALL_EPEL="${2,,}" INSTALL_EPEL="${2,,}"
shift shift
@@ -5002,8 +5002,8 @@ function CommandOptions() {
;; ;;
## 关闭防火墙 ## 关闭防火墙
--close-firewall) --close-firewall)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
[Tt]rue | [Ff]alse) [Tt]rue | [Ff]alse)
CLOSE_FIREWALL="${2,,}" CLOSE_FIREWALL="${2,,}"
shift shift
@@ -5018,8 +5018,8 @@ function CommandOptions() {
;; ;;
## 备份原有软件源 ## 备份原有软件源
--backup) --backup)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
[Tt]rue | [Ff]alse) [Tt]rue | [Ff]alse)
BACKUP="${2,,}" BACKUP="${2,,}"
shift shift
@@ -5038,8 +5038,8 @@ function CommandOptions() {
;; ;;
## 更新软件包 ## 更新软件包
--updata-software) --updata-software)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
[Tt]rue | [Ff]alse) [Tt]rue | [Ff]alse)
UPDATA_SOFTWARE="${2,,}" UPDATA_SOFTWARE="${2,,}"
shift shift
@@ -5054,8 +5054,8 @@ function CommandOptions() {
;; ;;
## 清理下载缓存 ## 清理下载缓存
--clean-cache) --clean-cache)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
[Tt]rue | [Ff]alse) [Tt]rue | [Ff]alse)
CLEAN_CACHE="${2,,}" CLEAN_CACHE="${2,,}"
shift shift

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## Author: SuperManito ## Author: SuperManito
## Modified: 2023-05-12 ## Modified: 2023-05-25
## License: MIT ## License: MIT
## Github: https://github.com/SuperManito/LinuxMirrors ## Github: https://github.com/SuperManito/LinuxMirrors
## Website: https://linuxmirrors.cn ## Website: https://linuxmirrors.cn
@@ -721,10 +721,10 @@ function CommandOptions() {
## 判断参数 ## 判断参数
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case "$1" in
## 指定 Docker CE 软件源地址 ## 指定 Docker CE 软件源地址
--source) --source)
if [ $2 ]; then if [ "$2" ]; then
echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!"
@@ -738,7 +738,7 @@ function CommandOptions() {
;; ;;
## 指定 Docker Hub 仓库地址 ## 指定 Docker Hub 仓库地址
--source-registry) --source-registry)
if [ $2 ]; then if [ "$2" ]; then
echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}" echo "$2" | grep -Eq "\-|\(|\)|\[|\]|\{|\}"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!" Output_Error "检测到无效参数值 ${BLUE}$2${PLAIN} ,请输入有效的地址!"
@@ -752,8 +752,8 @@ function CommandOptions() {
;; ;;
## 安装最新版本 ## 安装最新版本
--install-latested) --install-latested)
if [ $2 ]; then if [ "$2" ]; then
case $2 in case "$2" in
[Tt]rue | [Ff]alse) [Tt]rue | [Ff]alse)
INSTALL_LATESTED_DOCKER="${2,,}" INSTALL_LATESTED_DOCKER="${2,,}"
shift shift