From 44fcd0f579e9d411430174f35300f0aa021c0862 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 29 Jan 2021 19:26:09 +0800 Subject: [PATCH] Update index.py --- plugins/swap/index.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/swap/index.py b/plugins/swap/index.py index ed5eff9a4..0f4a3202e 100755 --- a/plugins/swap/index.py +++ b/plugins/swap/index.py @@ -92,7 +92,7 @@ def initDreplace(): def start(): file = initDreplace() data = mw.execShell(file + ' start') - if data[0] == '': + if data[1] == '': return 'ok' return 'fail' @@ -100,17 +100,25 @@ def start(): def stop(): file = initDreplace() data = mw.execShell(file + ' stop') - if data[0] == '': + if data[1] == '': return 'ok' return 'fail' def restart(): - return 'ok' + file = initDreplace() + data = mw.execShell(file + ' restart') + if data[1] == '': + return 'ok' + return 'fail' def reload(): - return 'ok' + file = initDreplace() + data = mw.execShell(file + ' reload') + if data[1] == '': + return 'ok' + return 'fail' def initdStatus():