From 440fa1c5351e9ce5427a29b9e30540ae9fe01124 Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 20 Nov 2022 12:06:24 +0800 Subject: [PATCH] up --- class/core/common.py | 13 ++++++++++++- route/static/app/files.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/class/core/common.py b/class/core/common.py index 10643fc40..3d2b94a27 100755 --- a/class/core/common.py +++ b/class/core/common.py @@ -100,6 +100,9 @@ def initInitD(): if not mw.isAppleSystem() and not os.path.exists("/etc/rc.d/init.d"): mw.execShell('mkdir -p /etc/rc.d/init.d') + if not mw.isAppleSystem() and not os.path.exists("/etc/init.d"): + mw.execShell('mkdir -p /etc/init.d') + # initd if os.path.exists('/etc/rc.d/init.d'): initd_bin = '/etc/rc.d/init.d/mw' @@ -107,8 +110,16 @@ def initInitD(): import shutil shutil.copyfile(script_bin, initd_bin) mw.execShell('chmod +x ' + initd_bin) - # 加入自启动 + mw.execShell('which chkconfig && chkconfig --add mw') + + if os.path.exists('/etc/init.d'): + initd_bin = '/etc/init.d/mw' + if not os.path.exists(initd_bin): + import shutil + shutil.copyfile(script_bin, initd_bin) + mw.execShell('chmod +x ' + initd_bin) + # 加入自启动 mw.execShell('which update-rc.d && update-rc.d -f mw defaults') # 获取系统IPV4 diff --git a/route/static/app/files.js b/route/static/app/files.js index 541d85c8d..04330459c 100755 --- a/route/static/app/files.js +++ b/route/static/app/files.js @@ -492,7 +492,7 @@ function getFiles(Path) {
  • 新建空白文件
  • \
  • 新建目录
  • \ \ - '; + '; if (rdata.PATH != '/') { BarTools += ' '; }