use strict;
use warnings;


open FILE, '>', "ext_static100.ldif" or die "Can't open ext_static.ldif : $!\n";

my $head ="version: 1

dn: cn=10.0.2.0,cn=INTERNAL,cn=DHCP Config,dc=skole,dc=skolelinux,dc=no
changetype: modify
replace: dhcpRange
dhcpRange: 10.0.2.100 10.0.3.153
-
\n";

print FILE  $head ;  

for(my $i=310; $i<400; $i++){
	my $j=$i-156;
	my $foo ="dn: dc=dhcp$i,dc=intern,ou=hosts,dc=skole,dc=skolelinux,dc=no
changetype: delete\n
dn: dc=$j,dc=3,dc=0,dc=10,dc=in-addr,dc=arpa,ou=hosts,dc=skole,dc=skolelinux,dc=no
changetype: delete\n
";
	print FILE  $foo ;          
}


for(my $i=50; $i<150; $i++){
	my $j=$i+104;
	my $foo ="dn: dc=static$i,dc=intern,ou=hosts,dc=skole,dc=skolelinux,dc=no
changetype: add
objectclass: top
objectclass: dnsdomain
objectclass: domainrelatedobject
dc: static$i
arecord: 10.0.3.$j
associateddomain: static$i.intern

dn: dc=$j,dc=3,dc=0,dc=10,dc=in-addr,dc=arpa,ou=hosts,dc=skole,dc=skolelinux,dc=no
changetype: add
objectclass: top
objectclass: dnsdomain2
objectclass: domainrelatedobject
dc: $j
ptrrecord: static$i.intern
associateddomain: $j.3.0.10.in-addr.arpa\n
";
	print FILE  $foo ;          
}


close FILE;
