修复脚本中输出重定向兼容性

This commit is contained in:
Ing 2025-05-15 13:26:13 +08:00
parent 798e03dfba
commit 723936afd8
3 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ function create() {
sudo apt install -y locales busybox dialog gettext sed gawk jq curl
sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils dosfstools cpio xz-utils lz4 lzma bzip2 gzip zstd
# sudo snap install yq
if ! type yq &>/dev/null || ! yq --version 2>/dev/null | grep -q "v4."; then
if ! type yq >/dev/null 2>&1 || ! yq --version 2>/dev/null | grep -q "v4."; then
sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq
fi

View File

@ -329,7 +329,7 @@ function createvmx() {
local BLIMAGE=${1}
local VMNAME=${2}
if ! type qemu-img &>/dev/null; then
if ! type qemu-img >/dev/null 2>&1; then
sudo apt install -y qemu-utils
fi

View File

@ -9,7 +9,7 @@
# sudo apt install -y locales busybox dialog gettext sed gawk jq curl
# sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils dosfstools cpio xz-utils lz4 lzma bzip2 gzip zstd
# # sudo snap install yq
# if ! type yq &>/dev/null || ! yq --version 2>/dev/null | grep -q "v4."; then
# if ! type yq >/dev/null 2>&1 || ! yq --version 2>/dev/null | grep -q "v4."; then
# sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq
# fi
#