@whyour/qinglong 2.19.0-8 → 2.19.0-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/shell/start.sh +44 -44
package/package.json
CHANGED
package/shell/start.sh
CHANGED
|
@@ -34,40 +34,36 @@ fi
|
|
|
34
34
|
|
|
35
35
|
command="$1"
|
|
36
36
|
|
|
37
|
-
if [[ $command
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
if [[ $command != "reload" ]]; then
|
|
38
|
+
# 安装依赖
|
|
39
|
+
os_name=$(source /etc/os-release && echo "$ID")
|
|
40
|
+
|
|
41
|
+
if [[ $os_name == 'alpine' ]]; then
|
|
42
|
+
apk update
|
|
43
|
+
apk add -f bash \
|
|
44
|
+
coreutils \
|
|
45
|
+
git \
|
|
46
|
+
curl \
|
|
47
|
+
wget \
|
|
48
|
+
tzdata \
|
|
49
|
+
perl \
|
|
50
|
+
openssl \
|
|
51
|
+
jq \
|
|
52
|
+
nginx \
|
|
53
|
+
openssh \
|
|
54
|
+
procps \
|
|
55
|
+
netcat-openbsd
|
|
56
|
+
elif [[ $os_name == 'debian' ]] || [[ $os_name == 'ubuntu' ]]; then
|
|
57
|
+
apt-get update
|
|
58
|
+
apt-get install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client
|
|
59
|
+
else
|
|
60
|
+
echo -e "暂不支持此系统部署 $os_name"
|
|
61
|
+
exit 1
|
|
62
|
+
fi
|
|
42
63
|
|
|
43
|
-
|
|
44
|
-
os_name=$(source /etc/os-release && echo "$ID")
|
|
45
|
-
|
|
46
|
-
if [[ $os_name == 'alpine' ]]; then
|
|
47
|
-
apk update
|
|
48
|
-
apk add -f bash \
|
|
49
|
-
coreutils \
|
|
50
|
-
git \
|
|
51
|
-
curl \
|
|
52
|
-
wget \
|
|
53
|
-
tzdata \
|
|
54
|
-
perl \
|
|
55
|
-
openssl \
|
|
56
|
-
jq \
|
|
57
|
-
nginx \
|
|
58
|
-
openssh \
|
|
59
|
-
procps \
|
|
60
|
-
netcat-openbsd
|
|
61
|
-
elif [[ $os_name == 'debian' ]] || [[ $os_name == 'ubuntu' ]]; then
|
|
62
|
-
apt-get update
|
|
63
|
-
apt-get install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client
|
|
64
|
-
else
|
|
65
|
-
echo -e "暂不支持此系统部署 $os_name"
|
|
66
|
-
exit 1
|
|
64
|
+
npm install -g pnpm@8.3.1 pm2 ts-node
|
|
67
65
|
fi
|
|
68
66
|
|
|
69
|
-
npm install -g pnpm@8.3.1 pm2 ts-node
|
|
70
|
-
|
|
71
67
|
export PYTHON_SHORT_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
|
72
68
|
export PNPM_HOME=${QL_DIR}/data/dep_cache/node
|
|
73
69
|
export PYTHON_HOME=${QL_DIR}/data/dep_cache/python3
|
|
@@ -78,7 +74,9 @@ export NODE_PATH=/usr/local/bin:/usr/local/lib/node_modules:${PNPM_HOME}/global/
|
|
|
78
74
|
export PIP_CACHE_DIR=${PYTHON_HOME}/pip
|
|
79
75
|
export PYTHONPATH=${PYTHON_HOME}:${PYTHON_HOME}/lib/python${PYTHON_SHORT_VERSION}:${PYTHON_HOME}/lib/python${PYTHON_SHORT_VERSION}/site-packages
|
|
80
76
|
|
|
81
|
-
|
|
77
|
+
if [[ $command != "reload" ]]; then
|
|
78
|
+
pip3 install --prefix ${PYTHON_HOME} requests
|
|
79
|
+
fi
|
|
82
80
|
|
|
83
81
|
cd ${QL_DIR}
|
|
84
82
|
cp -f .env.example .env
|
|
@@ -107,20 +105,22 @@ pm2 l &>/dev/null
|
|
|
107
105
|
log_with_style "INFO" "🔄 2. 启动 nginx..."
|
|
108
106
|
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
|
109
107
|
|
|
110
|
-
log_with_style "INFO" "⚙️ 3. 启动 pm2
|
|
108
|
+
log_with_style "INFO" "⚙️ 3. 启动 pm2 服务..."
|
|
111
109
|
reload_pm2
|
|
112
110
|
|
|
113
|
-
if [[ $
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
if [[ $command != "reload" ]]; then
|
|
112
|
+
if [[ $AutoStartBot == true ]]; then
|
|
113
|
+
log_with_style "INFO" "🤖 4. 启动 bot..."
|
|
114
|
+
nohup ql bot >$dir_log/bot.log 2>&1 &
|
|
115
|
+
fi
|
|
117
116
|
|
|
118
|
-
if [[ $EnableExtraShell == true ]]; then
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
fi
|
|
117
|
+
if [[ $EnableExtraShell == true ]]; then
|
|
118
|
+
log_with_style "INFO" "🛠️ 5. 执行自定义脚本..."
|
|
119
|
+
nohup ql extra >$dir_log/extra.log 2>&1 &
|
|
120
|
+
fi
|
|
122
121
|
|
|
123
|
-
pm2 startup
|
|
124
|
-
pm2 save
|
|
122
|
+
pm2 startup
|
|
123
|
+
pm2 save
|
|
124
|
+
fi
|
|
125
125
|
|
|
126
|
-
log_with_style "SUCCESS" "🎉
|
|
126
|
+
log_with_style "SUCCESS" "🎉 启动成功!"
|