From 59df170455669c244f22df54ddfedb5b9480687e Mon Sep 17 00:00:00 2001 From: lsy Date: Thu, 12 Sep 2024 13:20:44 +0800 Subject: [PATCH] =?UTF-8?q?docker=E5=AE=89=E8=A3=85=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=8E=B7=E5=8F=96,docker=E6=8D=A2=E6=BA=90?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=BA=90=E6=95=B0=E7=BB=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?,=E5=A4=87=E4=BB=BDpython=E7=9B=B4=E6=8E=A5=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E4=B8=8D=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/Automation/backup.sh | 18 ++++++++---------- Menus/Docker.sh | 2 +- Menus/Software.sh | 1 + 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Config/Automation/backup.sh b/Config/Automation/backup.sh index f5a23d8..cd80e44 100644 --- a/Config/Automation/backup.sh +++ b/Config/Automation/backup.sh @@ -39,16 +39,14 @@ if [[ $local_pick =~ Yy ]];then fi if [[ ! $baidu_pick =~ [Nn] ]];then - if ! command -v python3 -m venv &> /dev/null ; then - if [[ -f "/usr/bin/apt-get" ]];then - sudo apt-get install python3-venv -y - elif [[ -f "/usr/bin/apt" ]];then - sudo apt-get install python3-venv -y - else - echo "无法自动安装 python3-venv 请手动安装" - exit - fi - fi + if [[ -f "/usr/bin/apt-get" ]];then + sudo apt-get install python3-venv -y + elif [[ -f "/usr/bin/apt" ]];then + sudo apt-get install python3-venv -y + else + echo "无法自动安装 python3-venv 请手动安装" + exit + fi python3 -m venv "${path}/venv" source "${path}/venv/bin/activate" pip install bypy diff --git a/Menus/Docker.sh b/Menus/Docker.sh index 1d684b2..c7baafc 100644 --- a/Menus/Docker.sh +++ b/Menus/Docker.sh @@ -36,7 +36,7 @@ if [[ $pick == '1' ]];then for i in "${!img_dick[@]}"; do img_pick=$(( img_pick+1 )) - declare[$img_pick]=$i + img_number[$img_pick]=$i echo "${img_pick}.${i}" done read -p "请输入要选择的镜像,也可直接输入镜像网站:" img_pick diff --git a/Menus/Software.sh b/Menus/Software.sh index a7ed966..24f527c 100644 --- a/Menus/Software.sh +++ b/Menus/Software.sh @@ -1,6 +1,7 @@ #!/bin/bash declare install_str +declare version="$(cat /etc/os-release | grep "^ID" | awk -F '=' '{print $2}')" declare pkg if [[ -f "/usr/bin/apt-get" ]];then