删除换源重复代码,修复docker菜单

This commit is contained in:
lsy 2024-09-21 18:07:23 +08:00
parent c64f6a5be9
commit f58014674f
2 changed files with 3 additions and 13 deletions

View File

@ -15,13 +15,11 @@ echo "========Docker========"
echo "1.换源" echo "1.换源"
echo "2.清除所有未使用镜像" echo "2.清除所有未使用镜像"
echo "-----一键搭建软件-----" echo "-----一键搭建软件-----"
cd "Config/Docker" for i in "${path_script}/Config/Docker"/*;do
for i in *;do
pick_number=$((pick_number + 1)) pick_number=$((pick_number + 1))
pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$i") pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$(basename $i)")
echo "${pick_number}.${pick_array[$pick_number]}" echo "${pick_number}.${pick_array[$pick_number]}"
done done
cd - >> /dev/null
echo "-----一键搭建软件-----" echo "-----一键搭建软件-----"
echo "任意输入返回主菜单" echo "任意输入返回主菜单"
echo "========Docker========" echo "========Docker========"

View File

@ -2,14 +2,6 @@
declare version=$(cat /etc/os-release | grep VERSION_CODENAME | awk -F '=' '{print $2}') declare version=$(cat /etc/os-release | grep VERSION_CODENAME | awk -F '=' '{print $2}')
case "$version" in
'bookworm')
;;
*)
echo "暂不支持该系统一键换源"
exit
esac
declare -A sources_dick declare -A sources_dick
sources_dick['中国科技技术大学(默认)']='http://mirrors.ustc.edu.cn' sources_dick['中国科技技术大学(默认)']='http://mirrors.ustc.edu.cn'
sources_dick['清华大学']='https://mirrors.tuna.tsinghua.edu.cn' sources_dick['清华大学']='https://mirrors.tuna.tsinghua.edu.cn'
@ -52,7 +44,7 @@ EOF
sudo apt-get update -y sudo apt-get update -y
;; ;;
*) *)
echo "暂不支持该系统配置自动更新软件" echo "暂不支持该系统一键换源"
exit exit
esac esac