From 64fb414335cef4e79be2f146bb5b7ed88a4ae9d6 Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 9 Dec 2018 12:50:30 +0800 Subject: [PATCH] Update index.py --- plugins/csvn/index.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/plugins/csvn/index.py b/plugins/csvn/index.py index e45c3fd51..8c94a5e6f 100755 --- a/plugins/csvn/index.py +++ b/plugins/csvn/index.py @@ -63,6 +63,12 @@ def status(): def csvnOp(method): + + if not app_debug: + os_name = public.getOs() + if os_name == 'darwin': + return "Apple Computer does not support" + _initd_csvn = '/etc/init.d/csvn' _initd_csvn_httpd = '/etc/init.d/csvn-httpd' @@ -113,9 +119,11 @@ def initdInstall(): _csvn = getServerDir() + '/bin/csvn' _csvn_httpd = getServerDir() + '/bin/csvn-httpd' - public.execShell(_csvn + ' install') - public.execShell(_csvn_httpd + ' install') - return 'ok' + ret_csvn = public.execShell(_csvn + ' install') + ret_csvn_httpd = public.execShell(_csvn_httpd + ' install') + if ret_csvn[1] == '' and ret_csvn_httpd[1] == '': + return 'ok' + return 'fail' def initdUinstall(): @@ -127,9 +135,11 @@ def initdUinstall(): _csvn = getServerDir() + '/bin/csvn' _csvn_httpd = getServerDir() + '/bin/csvn-httpd' - public.execShell(_csvn + ' uninstall') - public.execShell(_csvn_httpd + ' uninstall') - return 'ok' + ret_csvn = public.execShell(_csvn + ' remove') + ret_csvn_httpd = public.execShell(_csvn_httpd + ' remove') + if ret_csvn[1] == '' and ret_csvn_httpd[1] == '': + return 'ok' + return 'fail' if __name__ == "__main__": func = sys.argv[1]