From 2a0c0a3dbbdf7fa5040953c0b0d88ad6f62c011e Mon Sep 17 00:00:00 2001 From: Joachim Tingvold Date: Sun, 6 Apr 2014 03:11:04 +0200 Subject: Initial commit. Source; TG13-goodiebag. --- tools/make-dhcpd-include.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 tools/make-dhcpd-include.pl (limited to 'tools/make-dhcpd-include.pl') diff --git a/tools/make-dhcpd-include.pl b/tools/make-dhcpd-include.pl new file mode 100755 index 0000000..ded5551 --- /dev/null +++ b/tools/make-dhcpd-include.pl @@ -0,0 +1,18 @@ +#!/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 . "generated-include.conf"; + +my $glob = $dhcpd_base . "conf.d/*.conf"; +my @configs = glob($glob); + +open CONF, ">" . $includeconfig or die ( $! . " " . $includeconfig); +foreach my $config ( @configs ) +{ + print CONF "include \"" . $config . "\";\n"; +} +close CONF; -- cgit v1.2.3