From 586219f30401be7886c0fa76f85dab87697295ab Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 15 May 2021 01:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20ql=20update=20=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/update.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/shell/update.sh b/shell/update.sh index 256b7018..e51ccf6f 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -256,14 +256,18 @@ update_qinglong() { fi local url="https://gitee.com/whyour/qinglong-static.git" - rm -rf ${ql_static_repo} - git_clone_scripts ${url} ${ql_static_repo} + if [ -d ${ql_static_repo}/.git ]; then + reset_romote_url ${ql_static_repo} ${url} + git_pull_scripts ${ql_static_repo} + else + git_clone_scripts ${url} ${ql_static_repo} + fi if [[ $exit_status -eq 0 ]]; then echo -e "\n更新$ql_static_repo成功...\n" cp -rf $ql_static_repo/* $dir_root echo -e "重启面板中..." nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf - sleep 1 && pm2 reload all >/dev/null 2>&1 + pm2 reload all >/dev/null 2>&1 else echo -e "\n更新$dir_root失败,请检查原因...\n" fi