Update init_cmd.py

pull/632/head
Mr Chen 5 months ago
parent 371b6651f0
commit 30e2ea56c8
  1. 10
      web/admin/setup/init_cmd.py

@ -39,8 +39,9 @@ def init_cmd():
initd_bin = '/etc/rc.d/init.d/mw'
# if not os.access(initd_bin, os.W_OK):
# return False
shutil.copyfile(script_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
if not os.path.exists(initd_bin):
shutil.copyfile(script_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
# 加入自启动
mw.execShell('which chkconfig && chkconfig --add mw')
@ -48,8 +49,9 @@ def init_cmd():
initd_bin = '/etc/init.d/mw'
# if not os.access(initd_bin, os.W_OK):
# return False
shutil.copyfile(script_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
if not os.path.exists(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