diff options
-rw-r--r-- | source4/provision.ldif | 2 | ||||
-rwxr-xr-x | source4/script/provision.pl | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source4/provision.ldif b/source4/provision.ldif index 460549db1d..1adb8600b3 100644 --- a/source4/provision.ldif +++ b/source4/provision.ldif @@ -36,7 +36,7 @@ objectClass: domain objectClass: domainDNS name: ${DOMAIN} realm: ${REALM} -dnsDomain: ${REALM} +dnsDomain: ${DNSDOMAIN} dc: ${DOMAIN} objectGUID: ${NEWGUID} creationTime: ${NTTIME} diff --git a/source4/script/provision.pl b/source4/script/provision.pl index b1070d2013..8863653e34 100755 --- a/source4/script/provision.pl +++ b/source4/script/provision.pl @@ -12,6 +12,7 @@ my $opt_nobody; my $opt_nogroup; my $opt_wheel; my $opt_users; +my $dnsdomain; my $dnsname; my $basedn; @@ -87,6 +88,10 @@ sub substitute($) return $opt_realm; } + if ($var eq "DNSDOMAIN") { + return $dnsdomain; + } + if ($var eq "HOSTNAME") { return $opt_hostname; } @@ -230,6 +235,10 @@ if ($opt_help || ShowHelp(); } +$opt_realm=uc($opt_realm); +$opt_domain=uc($opt_domain); +$opt_hostname=uc($opt_hostname); + print "Provisioning host '$opt_hostname' for domain '$opt_domain' in realm '$opt_realm'\n"; if (!$opt_nobody) { @@ -269,7 +278,8 @@ print "Using nobody='$opt_nobody' nogroup='$opt_nogroup' wheel='$opt_wheel' u print "generating ldif ...\n"; -$dnsname = "$opt_hostname.$opt_realm"; +$dnsdomain = lc($opt_realm); +$dnsname = lc($opt_hostname).".".$dnsdomain; $basedn = "DC=" . join(",DC=", split(/\./, $opt_realm)); my $data = FileLoad("provision.ldif") || die "Unable to load provision.ldif\n"; |