Update Nlbench_beta.sh

This commit is contained in:
Jensfrank 2024-07-17 23:03:15 +08:00 committed by GitHub
parent b1a2980d4a
commit bf7f1f074b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -219,23 +219,6 @@ sum_run_times() {
# 调用函数获取统计数据
sum_run_times
# 更新系统
update_system() {
if command -v apt &>/dev/null; then
apt-get update && apt-get upgrade -y
elif command -v dnf &>/dev/null; then
dnf check-update && dnf upgrade -y
elif command -v yum &>/dev/null; then
yum check-update && yum upgrade -y
elif command -v apk &>/dev/null; then
apk update && apk upgrade
else
echo -e "${RED}不支持的Linux发行版${NC}"
return 1
fi
return 0
}
# 执行单个脚本并输出结果到文件
run_script() {
local script_number=$1
@ -424,10 +407,10 @@ run_selected_scripts() {
while true; do
read -p "请输入要执行的脚本编号用英文逗号分隔例如1,2,3):" script_numbers
if [[ "$script_numbers" =~ ^[0-9](,[0-9])*$ ]]; then
if [[ "$script_numbers" =~ ^[0-10](,[0-10])*$ ]]; then
break
else
echo -e "${RED}无效输入请输入0-9之间的数字,用英文逗号分隔。${NC}"
echo -e "${RED}无效输入请输入0-10之间的数字,用英文逗号分隔。${NC}"
fi
done