|
|
@ -176,11 +176,12 @@ def initDSend(): |
|
|
|
mw.writeFile(file_bin, content) |
|
|
|
mw.writeFile(file_bin, content) |
|
|
|
mw.execShell('chmod +x ' + file_bin) |
|
|
|
mw.execShell('chmod +x ' + file_bin) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lock_file = getServerDir() + "/installed.pl" |
|
|
|
# systemd |
|
|
|
# systemd |
|
|
|
systemDir = mw.systemdCfgDir() |
|
|
|
systemDir = mw.systemdCfgDir() |
|
|
|
systemService = systemDir + '/lsyncd.service' |
|
|
|
systemService = systemDir + '/lsyncd.service' |
|
|
|
systemServiceTpl = getPluginDir() + '/init.d/lsyncd.service.tpl' |
|
|
|
systemServiceTpl = getPluginDir() + '/init.d/lsyncd.service.tpl' |
|
|
|
if os.path.exists(systemDir) and not os.path.exists(systemService): |
|
|
|
if not os.path.exists(lock_file): |
|
|
|
lsyncd_bin = mw.execShell('which lsyncd')[0].strip() |
|
|
|
lsyncd_bin = mw.execShell('which lsyncd')[0].strip() |
|
|
|
if lsyncd_bin == '': |
|
|
|
if lsyncd_bin == '': |
|
|
|
print('lsyncd missing!') |
|
|
|
print('lsyncd missing!') |
|
|
@ -192,6 +193,8 @@ def initDSend(): |
|
|
|
mw.writeFile(systemService, content) |
|
|
|
mw.writeFile(systemService, content) |
|
|
|
mw.execShell('systemctl daemon-reload') |
|
|
|
mw.execShell('systemctl daemon-reload') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mw.writeFile(lock_file, "ok") |
|
|
|
|
|
|
|
|
|
|
|
lslog = getLsyncdLog() |
|
|
|
lslog = getLsyncdLog() |
|
|
|
if os.path.exists(lslog): |
|
|
|
if os.path.exists(lslog): |
|
|
|
mw.writeFile(lslog, '') |
|
|
|
mw.writeFile(lslog, '') |
|
|
|