1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

add -w to dhcp (#492)

This commit is contained in:
Zane C. Bowers-Hadley
2023-10-04 19:30:54 -05:00
committed by GitHub
parent 38d57626be
commit 6a7c04e549

View File

@ -58,6 +58,10 @@ for reporting purposes.
Default is 'cidr'.
=head2 -w <file>
Write the the output to this file.
=head1 Return JSON Data Hash
- .all_networks.cur :: Current leases for all networks
@ -106,9 +110,10 @@ use MIME::Base64;
use IO::Compress::Gzip qw(gzip $GzipError);
use Net::ISC::DHCPd::Leases;
use Net::ISC::DHCPd::Config;
use File::Slurp;
my %opts;
getopts( 'l:Zdpc:n:', \%opts );
getopts( 'l:Zdpc:n:w:', \%opts );
if ( !defined( $opts{n} ) ) {
$opts{n} = 'cidr';
@ -533,4 +538,8 @@ if ( $opts{Z} ) {
print $toReturn;
if ($opts{w}) {
write_file($opts{w}, $toReturn);
}
exit;