forked from curtinlv/gd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
33 lines (27 loc) · 862 Bytes
/
update.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
28
29
30
31
32
#!/usr/bin/env bash
set -e
daili='https://ghproxy.com'
if [ -d /ql/data/config ];then
QLMainPath='/ql/data'
else
QLMainPath='/ql'
fi
echo -e "当前青龙版本为:${QL_BRANCH}\n"
gitPull(){
echo -e "\n开始更新gd机器人\n"
rm -rf ${QLMainPath}repo/dockerbot/*
rm -rf ${QLMainPath}/repo/gd
cd ${QLMainPath}/repo/ && git clone ${daili}/https://github.com/curtinlv/gd.git
if [ ! -d ${QLMainPath}/repo/dockerbot ];then
mkdir ${QLMainPath}/repo/dockerbot
fi
ln -sf ${QLMainPath}/repo/gd ${QLMainPath}/repo/dockerbot/jbot
ln -sf ${QLMainPath}/repo/gd/conf ${QLMainPath}/repo/dockerbot/config
pm2 stop jbot && rm -rf ${QLMainPath}/jbot/* && cp -a ${QLMainPath}/repo/gd/* ${QLMainPath}/jbot/ && pm2 start jbot
}
# start
echo
echo -e "\n\t\t\t【更新机器人】\n"
echo
gitPull
echo -e "已完成更新"