diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index 3985cc0ef..da32377ee 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -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' diff --git a/plugins/php/index.py b/plugins/php/index.py index 88a17f1bf..46cccb5b1 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -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(): diff --git a/scripts/install/freebsd.sh b/scripts/install/freebsd.sh index d849c798a..169411295 100644 --- a/scripts/install/freebsd.sh +++ b/scripts/install/freebsd.sh @@ -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