pull/445/head
midoks 2 years ago
parent 9399a14a92
commit 010624023f
  1. 16
      plugins/openresty/index.py
  2. 2
      plugins/php/index.py
  3. 2
      scripts/install/freebsd.sh

@ -11,9 +11,7 @@ import re
sys.path.append(os.getcwd() + "/class/core")
import mw
app_debug = False
if mw.isAppleSystem():
app_debug = True
@ -31,6 +29,7 @@ def getServerDir():
def getInitDFile():
# sysrc openresty_enable=YES
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
@ -225,8 +224,8 @@ def initDreplace():
# /usr/lib/systemd/system
systemDir = mw.systemdCfgDir()
systemService = systemDir + '/openresty.service'
systemServiceTpl = getPluginDir() + '/init.d/openresty.service.tpl'
if os.path.exists(systemDir) and not os.path.exists(systemService):
systemServiceTpl = getPluginDir() + '/init.d/openresty.service.tpl'
se_content = mw.readFile(systemServiceTpl)
se_content = se_content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(systemService, se_content)
@ -321,9 +320,18 @@ def initdStatus():
def initdInstall():
if mw.isAppleSystem():
current_os = mw.getOs()
if getOs() == 'darwin':
return "Apple Computer does not support"
# freebsd initd install
if current_os.startswith('freebsd'):
source_bin = initDreplace()
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
# mw.execShell('chkconfig --add ' + getPluginName())
mw.execShell('systemctl enable openresty')
return 'ok'

@ -12,8 +12,6 @@ import shutil
# sys.setdefaultencoding('utf8')
sys.path.append(os.getcwd() + "/class/core")
# sys.path.append("/usr/local/lib/python3.6/site-packages")
import mw
if mw.isAppleSystem():

@ -78,7 +78,7 @@ if [ "$FW_ENABLE" == "" ];then
fi
# ipfw list
# service ipfw start
service ipfw stop
cd /www/server/mdserver-web/scripts && bash lib.sh

Loading…
Cancel
Save