This commit is contained in:
midoks
2022-10-20 16:31:30 +08:00
parent 65d07d3934
commit fb94fb8304
3 changed files with 14 additions and 7 deletions
+7 -2
View File
@@ -161,19 +161,24 @@ def isInstalledWeb():
def restartWeb():
return opWeb("reload")
def opWeb(method):
if not isInstalledWeb():
return False
# systemd
systemd = '/lib/systemd/system/openresty.service'
if os.path.exists(systemd):
execShell('systemctl reload openresty')
execShell('systemctl ' + method + ' openresty')
return True
# initd
initd = getServerDir() + '/openresty/init.d/openresty'
if os.path.exists(initd):
execShell(initd + ' ' + 'reload')
execShell(initd + ' ' + method)
return True
return False