mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-13 14:43:09 +00:00
enabling port configuration for rsyncssh
This commit is contained in:
parent
23dbbe5ecd
commit
f9231a11b2
@ -79,7 +79,7 @@ rsyncssh.action = function( inlet )
|
|||||||
spawn(
|
spawn(
|
||||||
event,
|
event,
|
||||||
config.ssh.binary,
|
config.ssh.binary,
|
||||||
-- config.ssh._computed, TODO XXX
|
config.ssh._computed,
|
||||||
config.host,
|
config.host,
|
||||||
'mv',
|
'mv',
|
||||||
'\"' .. config.targetdir .. event.path .. '\"',
|
'\"' .. config.targetdir .. event.path .. '\"',
|
||||||
@ -138,7 +138,7 @@ rsyncssh.action = function( inlet )
|
|||||||
config.ssh.binary,
|
config.ssh.binary,
|
||||||
'<', table.concat(paths, config.xargs.delimiter),
|
'<', table.concat(paths, config.xargs.delimiter),
|
||||||
params,
|
params,
|
||||||
-- config.ssh._computed, TODO XXX
|
config.ssh._computed,
|
||||||
config.host,
|
config.host,
|
||||||
config.xargs.binary,
|
config.xargs.binary,
|
||||||
config.xargs._extra
|
config.xargs._extra
|
||||||
@ -261,15 +261,45 @@ rsyncssh.prepare = function( config, level )
|
|||||||
default.rsync.prepare( config, level + 1, true )
|
default.rsync.prepare( config, level + 1, true )
|
||||||
|
|
||||||
if not config.host then
|
if not config.host then
|
||||||
error('default.rsyncssh needs "host" configured', 4)
|
error(
|
||||||
|
'default.rsyncssh needs "host" configured',
|
||||||
|
level
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not config.targetdir then
|
if not config.targetdir then
|
||||||
error('default.rsyncssh needs "targetdir" configured', 4)
|
error(
|
||||||
|
'default.rsyncssh needs "targetdir" configured',
|
||||||
|
level
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if config.rsyncOps then
|
--
|
||||||
error('did you mean rsyncOpts with "t"?', 4)
|
-- computes the ssh options
|
||||||
|
--
|
||||||
|
if config.ssh._computed then
|
||||||
|
error(
|
||||||
|
'please do not use the internal rsync._computed parameter',
|
||||||
|
level
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
local cssh = config.rsync;
|
||||||
|
cssh._computed = { }
|
||||||
|
local computed = cssh._computed
|
||||||
|
local computedN = 1
|
||||||
|
|
||||||
|
if cssh._extra then
|
||||||
|
for k, v in ipairs( cssh._extra ) do
|
||||||
|
computed[ computedN ] = v
|
||||||
|
computedN = computedN + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if cssh.port then
|
||||||
|
computed[ computedN ] = '-p'
|
||||||
|
computed[ computedN + 1 ] = cssh.port
|
||||||
|
computedN = computedN + 2
|
||||||
end
|
end
|
||||||
|
|
||||||
-- appends a slash to the targetdir if missing
|
-- appends a slash to the targetdir if missing
|
||||||
|
Loading…
Reference in New Issue
Block a user