aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/make-dhcpd-include.pl
blob: 86673cb93fa9899567e49430a7e82b166a5bfe8e (plain)
1
2
3
4
5
6
7
8
9
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keywo
#!/usr/bin/perl -I /root/tgmanage
use strict;
my $base = "/etc";
$base = $ARGV[0] if $#ARGV > -1;
$base .= "/" if not $base =~ m/\/$/ and not $base eq "";

my $dhcpd_base = $base . "dhcp/";
my $includeconfig = $dhcpd_base . "v4-generated-include.conf";

my $glob = $dhcpd_base . "conf-v4/*.conf";
my @configs = glob($glob);

open CONF, ">" . $includeconfig or die ( $! . " " . $includeconfig);
foreach my $config ( @configs )
{
	print CONF "include \"" . $config . "\";\n";
}
close CONF;

$includeconfig = $dhcpd_base . "v6-generated-include.conf";

my $glob = $dhcpd_base . "conf-v6/*.conf";
my @configs = glob($glob);

open CONF, ">" . $includeconfig or die ( $! . " " . $includeconfig);
foreach my $config ( @configs )
{
	print CONF "include \"" . $config . "\";\n";
}
close CONF;