Последняя активность 1 month ago

Update Samba4 IP with samba-tool

racerxdl's Avatar Lucas Teske ревизий этого фрагмента 8 years ago. К ревизии

1 file changed, 20 insertions

updateip.sh(файл создан)

@@ -0,0 +1,20 @@
1 + #!/bin/bash
2 +
3 + DOMAIN=$1
4 + OLDIP=$2
5 + NEWIP=$3
6 + SERVERNAME=$4
7 +
8 + echo "Adding new IP to domain"
9 + samba-tool dns add localhost $DOMAIN $SERVERNAME.$DOMAIN A $NEWIP
10 + samba-tool dns add localhost $DOMAIN $DOMAIN A $NEWIP
11 + samba-tool dns add localhost _msdcs.$DOMAIN gc A $NEWIP
12 + samba-tool dns add localhost $DOMAIN DomainDnsZones.$DOMAIN A $NEWIP
13 + samba-tool dns add localhost $DOMAIN ForestDnsZones.$DOMAIN A $NEWIP
14 +
15 + echo "Removing old IP from domain"
16 + samba-tool dns delete localhost _msdcs.$DOMAIN gc A $OLDIP
17 + samba-tool dns delete localhost $DOMAIN $SERVERNAME.$DOMAIN A $OLDIP
18 + samba-tool dns delete localhost $DOMAIN $DOMAIN A $OLDIP
19 + samba-tool dns delete localhost $DOMAIN DomainDnsZones.$DOMAIN A $OLDIP
20 + samba-tool dns delete localhost $DOMAIN ForestDnsZones.$DOMAIN A $OLDIP
Новее Позже