1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
samba-mirror/source4/scripting/devel/drs/vampire_ad.sh
Andreas Schneider 8e2f5020cd s4:scripting: Reformat shell scripts
shfmt -f source4/scripting/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-07-08 09:05:56 +00:00

29 lines
855 B
Bash
Executable File

#!/bin/bash
set -x
. $(dirname $0)/vars
namedtmp=$(mktemp named.conf.ad.XXXXXXXXX)
cp $(dirname $0)/named.conf.ad.template $namedtmp
sed -i "s/DNSDOMAIN/$DNSDOMAIN/g" $namedtmp
sed -i "s/SERVERIP/$server_ip/g" $namedtmp
chmod a+r $namedtmp
mv -f $namedtmp $PREFIX/private/named.conf
sudo rndc reconfig
$(dirname $0)/unvampire_ad.sh
cat <<EOF >nsupdate.txt
update delete $DNSDOMAIN A $machine_ip
show
send
EOF
echo "$pass" | kinit administrator
nsupdate -g nsupdate.txt
REALM="$(echo $DNSDOMAIN | tr '[a-z]' '[A-Z]')"
sudo $GDB bin/samba-tool domain join $DNSDOMAIN DC -Uadministrator%$pass -s $PREFIX/etc/smb.conf --option=realm=$REALM --option="ads:dc function level=4" --option="ads:min function level=0" -d2 "$@" || exit 1
# PRIVATEDIR=$PREFIX/private sudo -E scripting/bin/setup_dns.sh $machine $DNSDOMAIN $machine_ip || exit 1
#sudo rndc flush