refactor: 移除重复的jq安装检查并使用外部脚本

This commit is contained in:
Olia Lisa 2025-02-08 18:12:01 +08:00
parent 14e6d30cd3
commit 496eb641e6

View File

@ -1,20 +1,11 @@
#!/bin/bash
# 检查 jq 是否安装
if ! command -v jq &> /dev/null; then
echo "安装jq命令"
# 如果是Ubuntu系统
if [ -f /etc/lsb-release ]; then
sudo apt-get update
sudo apt-get install -y jq
fi
# 如果是CentOS系统
if [ -f /etc/redhat-release ]; then
sudo yum install -y jq
fi
fi
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
source "$script_dir/utils/package_manager.sh"
# 检查jq是否安装
check_jq
# 生成uui, 写入到config.json文件
bash $script_dir/update_uuid.sh