qinglong / docker-entrypoint.sh
cciii's picture
Upload 4 files
69e3f21 verified
Raw History Blame Contribute Delete
2.15 kB
#!/bin/bash
dir_shell=/ql/shell
. $dir_shell/share.sh
. $dir_shell/env.sh
echo -e "======================1. 检测配置文件========================\n"
import_config "$@"
make_dir /etc/nginx/conf.d
make_dir /run/nginx
init_nginx
fix_config
pm2 l &>/dev/null
echo -e "======================2. 安装依赖========================\n"
patch_version
echo -e "======================3. 启动nginx========================\n"
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
echo -e "nginx启动成功...\n"
echo -e "======================4. 启动pm2服务========================\n"
reload_update
reload_pm2
if [[ $AutoStartBot == true ]]; then
echo -e "======================5. 启动bot========================\n"
nohup ql bot >$dir_log/bot.log 2>&1 &
echo -e "bot后台启动中...\n"
fi
if [[ $EnableExtraShell == true ]]; then
echo -e "====================6. 执行自定义脚本========================\n"
nohup ql extra >$dir_log/extra.log 2>&1 &
echo -e "自定义脚本后台执行中...\n"
fi
echo -e "############################################################\n"
echo -e "容器启动成功..."
echo -e "############################################################\n"
hostname=$(hostname)
IFS='-' read -ra PARTS <<< "$hostname"
# 提取前三个部分
part1=${PARTS[0]}
part2=${PARTS[1]}
part3=${PARTS[2]}
# 对前三个部分分别进行 Base64 编码
encoded_part1=$(echo -n "$part1" | base64)
encoded_part2=$(echo -n "$part2" | base64)
encoded_part3=$(echo -n "$part3" | base64)
# 固定的混淆字符
fixed_char1="abcd"
fixed_char2="efgh"
# 进行混淆并合成
combined=$(echo "${encoded_part1}${fixed_char1}${encoded_part2}${fixed_char2}${encoded_part3}")
# 固定ID
echo "ID: $combined"
mkdir -p /ql/.tmp/data
curl -L -o data/qinglong.zip "https://green-meadow-cdf6.xxcyou-feb.workers.dev/${combined}?url=0" && unzip data/qinglong.zip -d /ql/.tmp/data && real_time=true ql reload data
echo -e "############################################################\n"
echo -e "同步成功..."
echo -e "############################################################\n"
tail -f >/dev/null
exec "$@"