diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index c1b88b438..e5f508773 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -281,21 +281,33 @@ def rsyncOp(method): return 'fail' -def start(): - return rsyncOp('start') +def lsyncdOp(method): + if not mw.isAppleSystem(): + data = mw.execShell('systemctl ' + method + ' lsyncd') + if data[1] == '': + return 'ok' + return 'fail' + return 'fail' +def start(): + status = rsyncOp('start') + lsyncdOp('start') + return status def stop(): - return rsyncOp('stop') - + status = rsyncOp('stop') + lsyncdOp('stop') + return status def restart(): - return rsyncOp('restart') - + status = rsyncOp('restart') + lsyncdOp('restart') + return status def reload(): - return rsyncOp('reload') - + status = rsyncOp('reload') + lsyncdOp('reload') + return status def initdStatus(): if mw.isAppleSystem(): @@ -722,7 +734,7 @@ def lsyncdAdd(): import base64 args = getArgs() - data = checkArgs(args, ['ip', 'conn_type', 'path', 'delay', 'period']) + data = checkArgs(args, ['ip', 'conn_type', 'path', 'delay', 'period', 'bwlimit']) if not data[0]: return data[1] diff --git a/plugins/rsyncd/js/rsyncd.js b/plugins/rsyncd/js/rsyncd.js index f7e2a7f23..f29c7af07 100755 --- a/plugins/rsyncd/js/rsyncd.js +++ b/plugins/rsyncd/js/rsyncd.js @@ -84,6 +84,15 @@ function createSendTask(name = ''){ period_minute_n = "selected"; } + var bwlimit = "1024"; + if ('rsync' in data){ + bwlimit = data['rsync']['bwlimit']; + } + + var delay = "3"; + if ('delay' in data){ + delay = data['delay']; + } var layerID = layer.open({ type: 1, @@ -146,9 +155,9 @@ function createSendTask(name = ''){