diff --git a/plugins/dhcp/dhcp-pool b/plugins/dhcp/dhcp-pool index 09f39666..4f665c4b 100755 --- a/plugins/dhcp/dhcp-pool +++ b/plugins/dhcp/dhcp-pool @@ -29,6 +29,9 @@ # config (required) # # Version 1.0, 2-12-2008 +# +#%# family=auto +#%# capabilities=autoconf use POSIX; use Time::Local; @@ -38,7 +41,17 @@ my $CONFFILE = exists $ENV{'conffile'} ? $ENV{'conffile'} : "/etc/dhcpd.conf"; my $LEASEFILE = exists $ENV{'leasefile'} ? $ENV{'leasefile'} : "/var/lib/dhcp/dhcpd.leases"; if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) { - + if (-e ${CONFFILE} and -e ${LEASEFILE}) { + my %pools; + %pools = determine_pools(); + if (%pools) { + print "yes\n"; + } else { + print "no (no pools defined in config)\n"; + } + } else { + print "no (no config or lease file)\n"; + } } elsif ( defined $ARGV[0] and $ARGV[0] eq "config" ) { my (%pools, $start, $label);