优化openresty重启

pull/109/head
midoks 3 years ago
parent f4cc17cf3a
commit 5227e66531
  1. 15
      class/core/mw.py

@ -111,9 +111,22 @@ def isInstalledWeb():
def restartWeb():
if isInstalledWeb():
if not isInstalledWeb():
return False
# systemd
systemd = '/lib/systemd/system/openresty.service'
if os.path.exists(systemd):
execShell('systemctl restart openresty')
return True
# initd
initd = getServerDir() + '/openresty/init.d/openresty'
if os.path.exists(initd):
execShell(initd + ' ' + 'restart')
return True
return False
def restartMw():

Loading…
Cancel
Save