mirror of https://github.com/LilithSec/Lilith.git
fix daemonize bits
This commit is contained in:
parent
43a44d38bd
commit
0831d2059a
12
bin/lilith
12
bin/lilith
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env perl
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
@ -136,6 +136,8 @@ my $event_id;
|
|||
my $id;
|
||||
my $decode_raw;
|
||||
my $daemonize;
|
||||
my $user = 0;
|
||||
my $group = 0;
|
||||
Getopt::Long::Configure('no_ignore_case');
|
||||
Getopt::Long::Configure('bundling');
|
||||
GetOptions(
|
||||
|
@ -186,6 +188,8 @@ GetOptions(
|
|||
'event=s' => \$event_id,
|
||||
'raw' => \$decode_raw,
|
||||
'daemonize' => \$daemonize,
|
||||
'user=s' => \$user,
|
||||
'group=s' => \$user,
|
||||
);
|
||||
|
||||
# print version or help if requested
|
||||
|
@ -347,9 +351,9 @@ if ( $action eq 'run' ) {
|
|||
|
||||
print "\nConfigured Instances...\n" . to_toml( \%files ) . "\n\n\nCalling Lilith->run now....\n";
|
||||
|
||||
if (!$daemonize) {
|
||||
daemonize( undef, undef, '/var/run/lilith/pid' );
|
||||
};
|
||||
if ( $daemonize ) {
|
||||
daemonize( $user, $group, '/var/run/lilith/pid' );
|
||||
}
|
||||
|
||||
$lilith->run( files => \%files, );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue