From ea295d1e0a224a1b62b33d1966c1934061bb1f2b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 14 Feb 2019 15:19:36 +0800 Subject: [PATCH] update --- plugins/gogs/index.py | 8 ++++---- plugins/gogs/init.d/gogs.tpl | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/gogs/index.py b/plugins/gogs/index.py index 1a479e804..66a575e61 100755 --- a/plugins/gogs/index.py +++ b/plugins/gogs/index.py @@ -135,7 +135,7 @@ def start(): # print data if data[1] == '': return 'ok' - return data[1] + return data[0] def stop(): @@ -143,7 +143,7 @@ def stop(): data = public.execShell(file + ' stop') if data[1] == '': return 'ok' - return 'fail' + return data[1] def restart(): @@ -151,7 +151,7 @@ def restart(): data = public.execShell(file + ' reload') if data[1] == '': return 'ok' - return 'fail' + return data[1] def reload(): @@ -159,7 +159,7 @@ def reload(): data = public.execShell(file + ' reload') if data[1] == '': return 'ok' - return 'fail' + return data[1] def initdStatus(): diff --git a/plugins/gogs/init.d/gogs.tpl b/plugins/gogs/init.d/gogs.tpl index 7b63e95d2..af21a4fff 100644 --- a/plugins/gogs/init.d/gogs.tpl +++ b/plugins/gogs/init.d/gogs.tpl @@ -65,7 +65,12 @@ start() { stop() { cd ${GOGS_HOME} echo "Shutting down ${SERVICENAME}: \c" - pkill ${NAME} + which "killproc" > /dev/null + if [ $? -eq 0 ];then + killproc ${NAME} + else + pkill ${NAME} + fi RETVAL=$? [ $RETVAL = 0 ] && rm -f ${LOCKFILE} && echo "\033[32mdone\033[0m" }