|
|
@ -202,6 +202,13 @@ def status(): |
|
|
|
|
|
|
|
|
|
|
|
def start(): |
|
|
|
def start(): |
|
|
|
file = initDreplace() |
|
|
|
file = initDreplace() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not mw.isAppleSystem(): |
|
|
|
|
|
|
|
data = mw.execShell('systemctl start openresty') |
|
|
|
|
|
|
|
if data[1] == '': |
|
|
|
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
return 'fail' |
|
|
|
|
|
|
|
|
|
|
|
data = mw.execShell(file + ' start') |
|
|
|
data = mw.execShell(file + ' start') |
|
|
|
if data[1] == '': |
|
|
|
if data[1] == '': |
|
|
|
return 'ok' |
|
|
|
return 'ok' |
|
|
@ -210,6 +217,13 @@ def start(): |
|
|
|
|
|
|
|
|
|
|
|
def stop(): |
|
|
|
def stop(): |
|
|
|
file = initDreplace() |
|
|
|
file = initDreplace() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not mw.isAppleSystem(): |
|
|
|
|
|
|
|
data = mw.execShell('systemctl stop openresty') |
|
|
|
|
|
|
|
if data[1] == '': |
|
|
|
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
return 'fail' |
|
|
|
|
|
|
|
|
|
|
|
data = mw.execShell(file + ' stop') |
|
|
|
data = mw.execShell(file + ' stop') |
|
|
|
clearTemp() |
|
|
|
clearTemp() |
|
|
|
if data[1] == '': |
|
|
|
if data[1] == '': |
|
|
@ -219,6 +233,13 @@ def stop(): |
|
|
|
|
|
|
|
|
|
|
|
def restart(): |
|
|
|
def restart(): |
|
|
|
file = initDreplace() |
|
|
|
file = initDreplace() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not mw.isAppleSystem(): |
|
|
|
|
|
|
|
data = mw.execShell('systemctl restart openresty') |
|
|
|
|
|
|
|
if data[1] == '': |
|
|
|
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
return 'fail' |
|
|
|
|
|
|
|
|
|
|
|
data = mw.execShell(file + ' restart') |
|
|
|
data = mw.execShell(file + ' restart') |
|
|
|
if data[1] == '': |
|
|
|
if data[1] == '': |
|
|
|
return 'ok' |
|
|
|
return 'ok' |
|
|
@ -227,6 +248,13 @@ def restart(): |
|
|
|
|
|
|
|
|
|
|
|
def reload(): |
|
|
|
def reload(): |
|
|
|
file = initDreplace() |
|
|
|
file = initDreplace() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not mw.isAppleSystem(): |
|
|
|
|
|
|
|
data = mw.execShell('systemctl reload openresty') |
|
|
|
|
|
|
|
if data[1] == '': |
|
|
|
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
return 'fail' |
|
|
|
|
|
|
|
|
|
|
|
data = mw.execShell(file + ' reload') |
|
|
|
data = mw.execShell(file + ' reload') |
|
|
|
if data[1] == '': |
|
|
|
if data[1] == '': |
|
|
|
return 'ok' |
|
|
|
return 'ok' |
|
|
|