refactor: 简化jq安装检查逻辑
This commit is contained in:
parent
9d0fed291e
commit
14e6d30cd3
@ -1,14 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 检查 jq 是否安装
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "jq 未安装"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
|
||||
config_dir=$(readlink -f "$script_dir/../conf") # 配置文件绝对路径
|
||||
source "$script_dir/utils/package_manager.sh"
|
||||
|
||||
# 检查jq是否安装
|
||||
check_jq
|
||||
|
||||
# 获取本机IP
|
||||
ipv4=$(curl -4 -sSL --connect-timeout 3 --retry 2 ip.sb || echo "null")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user