Univention Bugzilla – Attachment 7635 Details for
Bug 41190
DDNS update of Samba/AD doesn't delete dnsRecord from dNSTombstoned Objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
refresh_dns_records_for_host
refresh_dns_records_for_host (text/plain), 1.15 KB, created by
Arvid Requate
on 2016-05-03 14:12:58 CEST
(
hide
)
Description:
refresh_dns_records_for_host
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2016-05-03 14:12:58 CEST
Size:
1.15 KB
patch
obsolete
>#!/bin/bash > >targethost="$1" >if [ -z "$1" ]; then > echo "usage: $0 <hostname>" > exit 2 >fi > >eval "$(ucr shell domainname kerberos/realm)" > >if ! klist -s || ! klist 2>/dev/null | grep -q "^ *Principal: Administrator@$kerberos_realm$"; then > kinit Administrator > if ! [ $? -eq 0 ]; then > exit 1 > fi >fi > >ldif=$(univention-s4search DC="$targethost" --cross-ncs --show-binary) > >tombstoned=0 >if grep -q 'dNSTombstoned: TRUE' <<<"$ldif"; then > dn=$(sed -n 's/^dn: //p' <<<"$ldif") > tombstoned=1 > ldbmodify -H /var/lib/samba/private/sam.ldb <<-%EOR > dn: $dn > changetype: modify > replace: dNSTombstoned > dNSTombstoned: FALSE > %EOR >fi > >txt=$(grep -E '(ipv4|ipv6)' <<<"$ldif" | sort | uniq) > >ipv4_addrs=( $(sed -n 's/^ *ipv4 *: //p' <<<"$txt") ) >ipv6_addrs=( $(sed -n 's/^ *ipv6 *: //p' <<<"$txt") ) > >{ >if [ -n "${ipv4_addrs}" ]; then > echo "update delete $targethost.$domainname A" > for ip in "${ipv4_addrs[@]}"; do > echo "update add $targethost.$domainname 900 A $ip" > done >fi >if [ -n "${ipv6_addrs}" ]; then > echo "update delete $targethost.$domainname AAAA" > for ip in "${ipv6_addrs[@]}"; do > echo "update add $targethost.$domainname 900 AAA $ip" > done >fi >echo send >} | nsupdate -g >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 41190
: 7635 |
8828
|
8836
|
8845