Update init_cmd.py

pull/632/head
Mr Chen 6 months ago
parent 52e98f6d41
commit 63145c736f
  1. 15
      web/admin/setup/init_cmd.py

@ -37,18 +37,19 @@ def init_cmd():
# initd
if os.path.exists('/etc/rc.d/init.d'):
initd_bin = '/etc/rc.d/init.d/mw'
if not os.path.exists(initd_bin):
shutil.copyfile(script_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
print(script_bin, initd_bin)
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)
print(script_bin, initd_bin)
shutil.copyfile(script_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
# 加入自启动
mw.execShell('which update-rc.d && update-rc.d -f mw defaults')
return True
Loading…
Cancel
Save