This commit is contained in:
Axel Kittenberger 2018-03-01 15:19:30 +01:00
parent ba52ee1a6f
commit faa582e259
1 changed files with 51 additions and 30 deletions

View File

@ -4662,7 +4662,10 @@ function runner.configure( args, monitors )
delay = delay =
{ {
1, 1,
function( secs ) function
(
secs
)
clSettings.delay = secs + 0 clSettings.delay = secs + 0
end end
}, },
@ -4670,7 +4673,8 @@ function runner.configure( args, monitors )
insist = insist =
{ {
0, 0,
function( ) function
( )
clSettings.insist = true clSettings.insist = true
end end
}, },
@ -4684,7 +4688,10 @@ function runner.configure( args, monitors )
logfile = logfile =
{ {
1, 1,
function( file ) function
(
file
)
clSettings.logfile = file clSettings.logfile = file
end end
}, },
@ -4692,16 +4699,21 @@ function runner.configure( args, monitors )
monitor = monitor =
{ {
-1, -1,
function( monitor ) function
if not monitor then (
monitor
)
if not monitor
then
io.stdout:write( 'This Lsyncd supports these monitors:\n' ) io.stdout:write( 'This Lsyncd supports these monitors:\n' )
for _, v in ipairs(Monitors.list) do for _, v in ipairs( Monitors.list )
io.stdout:write(' ',v,'\n') do
io.stdout:write( ' ', v, '\n' )
end end
io.stdout:write('\n') io.stdout:write('\n')
lsyncd.terminate(-1) lsyncd.terminate( -1 )
else else
clSettings.monitor = monitor clSettings.monitor = monitor
end end
@ -4711,7 +4723,8 @@ function runner.configure( args, monitors )
nodaemon = nodaemon =
{ {
0, 0,
function( ) function
( )
clSettings.nodaemon = true clSettings.nodaemon = true
end end
}, },
@ -4719,52 +4732,63 @@ function runner.configure( args, monitors )
pidfile = pidfile =
{ {
1, 1,
function( file ) function
(
file
)
clSettings.pidfile=file clSettings.pidfile=file
end end
}, },
rsync = rsync =
{ {
2, 2,
function( src, trg ) function
(
src,
trg
)
clSettings.syncs = clSettings.syncs or { } clSettings.syncs = clSettings.syncs or { }
table.insert( table.insert( clSettings.syncs, { 'rsync', src, trg } )
clSettings.syncs,
{ 'rsync', src, trg }
)
end end
}, },
rsyncssh = rsyncssh =
{ {
3, 3,
function( src, host, tdir ) function
(
src,
host,
tdir
)
clSettings.syncs = clSettings.syncs or { } clSettings.syncs = clSettings.syncs or { }
table.insert(
clSettings.syncs, table.insert( clSettings.syncs, { 'rsyncssh', src, host, tdir } )
{ 'rsyncssh', src, host, tdir }
)
end end
}, },
direct = direct =
{ {
2, 2,
function( src, trg ) function
(
src,
trg
)
clSettings.syncs = clSettings.syncs or { } clSettings.syncs = clSettings.syncs or { }
table.insert(
clSettings.syncs, table.insert( clSettings.syncs, { 'direct', src, trg } )
{ 'direct', src, trg }
)
end end
}, },
version = version =
{ {
0, 0,
function( ) function
( )
io.stdout:write( 'Version: ', lsyncd_version, '\n' ) io.stdout:write( 'Version: ', lsyncd_version, '\n' )
os.exit( 0 ) os.exit( 0 )
end end
} }
@ -4841,9 +4865,7 @@ function runner.configure( args, monitors )
os.exit( -1 ) os.exit( -1 )
end end
else else
if #nonopts == 0 if #nonopts == 0
then then
runner.help( args[ 0 ] ) runner.help( args[ 0 ] )
@ -4856,7 +4878,6 @@ function runner.configure( args, monitors )
os.exit( -1 ) os.exit( -1 )
end end
end end
end end