Update kvm.sh

This commit is contained in:
悟空的日常镜像仓库 2024-09-30 21:44:15 +08:00
parent 155fac06f8
commit 5b1a4f331f

View File

@ -365,6 +365,22 @@ update_scripts() {
exit 0 exit 0
} }
check_cpu_architecture() {
ARCH=$(uname -m)
if [[ "$ARCH" == "x86_64" ]]; then
echo -e " CPU型号:$(grep -m 1 "model name" /proc/cpuinfo | awk -F ': ' '{print $2}')"
elif [[ "$ARCH" == "aarch64" || "$ARCH" == "armv7l" ]]; then
if [[ -f /proc/device-tree/model ]]; then
echo -e " ARM机型:$(cat /proc/device-tree/model | tr -d '\0')"
else
echo -e " Board model information not available."
fi
else
echo -e " Unknown architecture: $ARCH"
fi
}
show_menu() { show_menu() {
clear clear
greenline "————————————————————————————————————————————————————" greenline "————————————————————————————————————————————————————"
@ -373,6 +389,7 @@ show_menu() {
环境: (Ubuntu/Debian/Armbian/RaspberryPiOS/fnOS etc) 环境: (Ubuntu/Debian/Armbian/RaspberryPiOS/fnOS etc)
平台: arm64/x86-64 平台: arm64/x86-64
' '
check_cpu_architecture
echo -e " https://github.com/wukongdaily/e20c/" echo -e " https://github.com/wukongdaily/e20c/"
greenline "————————————————————————————————————————————————————" greenline "————————————————————————————————————————————————————"
echo "请选择操作:" echo "请选择操作:"