mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update init_cmd.py
This commit is contained in:
@@ -39,16 +39,19 @@ def init_cmd():
|
|||||||
# initd
|
# initd
|
||||||
if os.path.exists('/etc/rc.d/init.d'):
|
if os.path.exists('/etc/rc.d/init.d'):
|
||||||
initd_bin = '/etc/rc.d/init.d/mw'
|
initd_bin = '/etc/rc.d/init.d/mw'
|
||||||
mw.writeFile(initd_bin, cmd_content)
|
if not os.path.exists(initd_bin):
|
||||||
mw.execShell('chmod +x ' + initd_bin)
|
mw.writeFile(initd_bin, cmd_content)
|
||||||
|
mw.execShell('chmod +x ' + initd_bin)
|
||||||
# 加入自启动
|
# 加入自启动
|
||||||
mw.execShell('which chkconfig && chkconfig --add mw')
|
mw.execShell('which chkconfig && chkconfig --add mw')
|
||||||
|
|
||||||
|
|
||||||
if os.path.exists('/etc/init.d'):
|
if os.path.exists('/etc/init.d'):
|
||||||
initd_bin = '/etc/init.d/mw'
|
initd_bin = '/etc/init.d/mw'
|
||||||
mw.writeFile(initd_bin, cmd_content)
|
|
||||||
mw.execShell('chmod +x ' + initd_bin)
|
if not os.path.exists(initd_bin):
|
||||||
|
mw.writeFile(initd_bin, cmd_content)
|
||||||
|
mw.execShell('chmod +x ' + initd_bin)
|
||||||
# 加入自启动
|
# 加入自启动
|
||||||
mw.execShell('which update-rc.d && update-rc.d -f mw defaults')
|
mw.execShell('which update-rc.d && update-rc.d -f mw defaults')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user