From c9be3c2a611e8f6edd759cd4d74a2f2e3211df48 Mon Sep 17 00:00:00 2001 From: wukongdaily <2666180@gmail.com> Date: Wed, 10 Apr 2024 11:00:25 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=A7=A3?= =?UTF-8?q?=E5=86=B3pv=E6=89=BE=E4=B8=8D=E5=88=B0=E5=BC=95=E8=B5=B7?= =?UTF-8?q?=E7=9A=84=E8=BD=AC=E6=8D=A2vdi=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/wukongdaily/diy-nas-onescript/issues/7 考虑到pv仅仅是一个解压进度条的显示,用处不大。 移除pv依赖并更换解压方式 --- shell/diy.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/shell/diy.sh b/shell/diy.sh index 3e7a60c..9584162 100644 --- a/shell/diy.sh +++ b/shell/diy.sh @@ -168,14 +168,6 @@ install_virtualbox_extpack() { # 格式转换 convert_vm_format() { echo "虚拟机一键格式转换(img2vdi)" - sudo apt-get update >/dev/null 2>&1 - if ! command -v pv &>/dev/null; then - echo "pv is not installed. Installing pv..." - sudo apt-get install pv -y || true - else - echo -e - fi - # 获取用户输入的文件路径 read -p "请将待转换的文件拖拽到此处(img|img.zip|img.gz): " file_path @@ -214,7 +206,7 @@ convert_vm_format() { elif [[ "$file_path" == *.img.gz ]]; then # 如果是 img.gz 文件,先解压 Show 0 "正在解压 img.gz 文件..." - pv "$file_path" | gunzip -c >"${file_path%.*}" || true + gzip -cd "$file_path" > "${file_path%.*}" || true img_file="${file_path%.*}" # 执行转换命令