forked from KagurazakaNyaa/privacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
27 lines (22 loc) · 1007 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# 设置环境变量
yq w config.yaml database.tables.qq $qq | yq w - database.tables.jd $jd | yq w - database.tables.sf $sf | yq w - database.tables.wb $wb | yq w - http.host $host | yq w - http.port $port | yq w - mask $mask | sponge config.yaml
# 如果不存在数据库,创建
if [[ ! -f database/database.db ]];then
mkdir -p database && sqlite3 database/database.db < scripts/database/create_database.sql
if [[ -f source/6.9更新总库.txt ]];then python scripts/qq.py;fi
if [[ -f source/www_jd_com_12g.txt ]];then python scripts/jd.py;fi
sqlite3 database/database.db < scripts/database/create_index.sql
fi
# 如果需要重新导入qq
if [[ -f database/.reimportqq ]];then
if [[ -f source/6.9更新总库.txt ]];then python scripts/qq.py;fi
rm database/.reimportqq
fi
# 如果需要重新导入jd
if [[ -f database/.reimportjd ]];then
if [[ -f source/www_jd_com_12g.txt ]];then python scripts/jd.py;fi
rm database/.reimportjd
fi
# 启动服务器
cd server && ./app