diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-07 14:08:03 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-07 14:08:46 +1000 |
commit | 5a22c0225abe2da11e844888475cbd9c40c6c47c (patch) | |
tree | df6f6f989d79e1ef4090ad5cbe26618e6871b15b /source4/scripting/bin | |
parent | becee4c164d6d2c3a65b9af0ac0457a1c5827319 (diff) | |
download | samba-5a22c0225abe2da11e844888475cbd9c40c6c47c.tar.gz samba-5a22c0225abe2da11e844888475cbd9c40c6c47c.tar.bz2 samba-5a22c0225abe2da11e844888475cbd9c40c6c47c.zip |
s4:setup_dns.sh fixed the update of the GUID CNAME
Diffstat (limited to 'source4/scripting/bin')
-rwxr-xr-x | source4/scripting/bin/setup_dns.sh | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/scripting/bin/setup_dns.sh b/source4/scripting/bin/setup_dns.sh index 20051c352e..e6a42811b8 100755 --- a/source4/scripting/bin/setup_dns.sh +++ b/source4/scripting/bin/setup_dns.sh @@ -6,8 +6,8 @@ exit 1 } -HOSTNAME="$1" -DOMAIN="$2" +HOSTNAME="$(echo $1 | tr '[a-z]' '[A-Z]')" +DOMAIN="$(echo $2 | tr '[a-z]' '[A-Z]')" IP="$3" RSUFFIX=$(echo $DOMAIN | sed s/[\.]/,DC=/g) @@ -18,12 +18,18 @@ OBJECTGUID=$(bin/ldbsearch -H "$PRIVATEDIR/sam.ldb" -b "CN=NTDS Settings,CN=$HOS echo "Found objectGUID $OBJECTGUID" -echo "Running kinit for BLU\$@VSOFS8.COM" -bin/samba4kinit -e arcfour-hmac-md5 -k -t "$PRIVATEDIR/secrets.keytab" BLU\$@VSOFS8.COM || exit 1 +echo "Running kinit for $HOSTNAME\$@$DOMAIN" +bin/samba4kinit -e arcfour-hmac-md5 -k -t "$PRIVATEDIR/secrets.keytab" $HOSTNAME\$@$DOMAIN || exit 1 echo "Adding $HOSTNAME.$DOMAIN" -scripting/bin/nsupdate-gss --noverify $HOSTNAME $DOMAIN $IP 300 || exit 1 -echo "Adding $OBJECTGUID.$DOMAIN => $HOSTNAME.$DOMAIN" -scripting/bin/nsupdate-gss --noverify --ntype="CNAME" $OBJECTGUID $DOMAIN $HOSTNAME.$DOMAIN 300 || exit 1 +scripting/bin/nsupdate-gss --noverify $HOSTNAME $DOMAIN $IP 300 || { + echo "Failed to add A record" + exit 1 +} +echo "Adding $OBJECTGUID._msdcs.$DOMAIN => $HOSTNAME.$DOMAIN" +scripting/bin/nsupdate-gss --realm=$DOMAIN --noverify --ntype="CNAME" $OBJECTGUID _msdcs.$DOMAIN $HOSTNAME.$DOMAIN 300 || { + echo "Failed to add CNAME" + exit 1 +} echo "Checking" host $HOSTNAME.$DOMAIN -host $OBJECTGUID.$DOMAIN +host $OBJECTGUID._msdcs.$DOMAIN |