xray_docker/bin/init.sh
2024-12-15 21:12:14 +08:00

24 lines
548 B
Bash

#!/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) # 脚本文件绝对路径
# 生成uui, 写入到config.json文件
bash $script_dir/update_uuid.sh
# 生成密钥对, 修改config.json中的密钥属性
bash $script_dir/update_key.sh