Skip to content

Commit

Permalink
add -w to dhcp (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
VVelox authored Oct 5, 2023
1 parent 38d5762 commit 6a7c04e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion snmp/dhcp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -533,4 +538,8 @@ if ( $opts{Z} ) {

print $toReturn;

if ($opts{w}) {
write_file($opts{w}, $toReturn);
}

exit;

0 comments on commit 6a7c04e

Please sign in to comment.