Spaces:
Running
Running
ykxVK8yL5L
commited on
Create docker-entrypoint.sh
Browse files- docker-entrypoint.sh +56 -0
docker-entrypoint.sh
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
dir_shell=/ql/shell
|
4 |
+
. $dir_shell/share.sh
|
5 |
+
. $dir_shell/env.sh
|
6 |
+
|
7 |
+
|
8 |
+
echo -e "======================写入rclone配置========================\n"
|
9 |
+
echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf
|
10 |
+
|
11 |
+
echo -e "======================1. 检测配置文件========================\n"
|
12 |
+
import_config "$@"
|
13 |
+
make_dir /etc/nginx/conf.d
|
14 |
+
make_dir /run/nginx
|
15 |
+
init_nginx
|
16 |
+
fix_config
|
17 |
+
|
18 |
+
pm2 l &>/dev/null
|
19 |
+
|
20 |
+
echo -e "======================2. 安装依赖========================\n"
|
21 |
+
patch_version
|
22 |
+
|
23 |
+
|
24 |
+
echo -e "======================3. 启动nginx========================\n"
|
25 |
+
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
26 |
+
echo -e "nginx启动成功...\n"
|
27 |
+
|
28 |
+
echo -e "======================4. 启动pm2服务========================\n"
|
29 |
+
reload_update
|
30 |
+
reload_pm2
|
31 |
+
|
32 |
+
if [[ $AutoStartBot == true ]]; then
|
33 |
+
echo -e "======================5. 启动bot========================\n"
|
34 |
+
nohup ql bot >$dir_log/bot.log 2>&1 &
|
35 |
+
echo -e "bot后台启动中...\n"
|
36 |
+
fi
|
37 |
+
|
38 |
+
if [[ $EnableExtraShell == true ]]; then
|
39 |
+
echo -e "====================6. 执行自定义脚本========================\n"
|
40 |
+
nohup ql extra >$dir_log/extra.log 2>&1 &
|
41 |
+
echo -e "自定义脚本后台执行中...\n"
|
42 |
+
fi
|
43 |
+
|
44 |
+
|
45 |
+
echo -e "############################################################\n"
|
46 |
+
echo -e "容器启动成功..."
|
47 |
+
echo -e "############################################################\n"
|
48 |
+
|
49 |
+
|
50 |
+
echo -e "##########写入登陆信息############"
|
51 |
+
echo "{ \"username\": \"$ADMIN_USERNAME\", \"password\": \"$ADMIN_PASSWORD\" }" > /ql/data/config/auth.json
|
52 |
+
|
53 |
+
|
54 |
+
tail -f /dev/null
|
55 |
+
|
56 |
+
exec "$@"
|