From b817190f0aafac32c2cefb8bcb191a31eb6f7b80 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 29 Jun 2022 09:33:14 +0800 Subject: [PATCH] =?UTF-8?q?gogs=20=E5=AE=89=E8=A3=85=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/gogs/install.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/gogs/install.sh b/plugins/gogs/install.sh index a00d2641e..f06e8f857 100755 --- a/plugins/gogs/install.sh +++ b/plugins/gogs/install.sh @@ -61,6 +61,9 @@ Install_gogs() if [ -d $serverPath/gogs ];then echo $version > $serverPath/gogs/version.pl + + cd ${rootPath} && python3 ${rootPath}/plugins/gogs/index.py start + cd ${rootPath} && python3 ${rootPath}/plugins/gogs/index.py initd_install fi # if id -u gogs > /dev/null 2>&1; then # echo "gogs user exists" @@ -75,11 +78,19 @@ Install_gogs() Uninstall_gogs() { - rm -rf $serverPath/gogs - if [ -f /usr/lib/systemd/system/gogs.service ];then + + if [ -f /lib/systemd/system/gogs.service ];then systemctl stop gogs - rm -rf /usr/lib/systemd/system/gogs.service + systemctl disable gogs + rm -rf /lib/systemd/system/gogs.service + systemctl daemon-reload fi + + if [ -f $serverPath/gogs/initd/gogs ];then + $serverPath/gogs/initd/gogs stop + fi + + rm -rf $serverPath/gogs echo 'uninstall success' > $install_tmp }