Add clear-net-cache.sh to install-fileserver-as-dc-member.sh
This commit is contained in:
parent
403610a643
commit
fd1961c0c2
@ -156,6 +156,17 @@ sudo tee /etc/security/pam_winbind.conf > /dev/null <<EOL
|
|||||||
debug = no
|
debug = no
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
|
sudo tee /usr/local/bin/clear-net-cache.sh > /dev/null <<EOL
|
||||||
|
service winbind stop
|
||||||
|
service smbd stop
|
||||||
|
net cache flush
|
||||||
|
rm /var/lib/samba/*.tdb
|
||||||
|
service smbd start
|
||||||
|
service winbind start
|
||||||
|
EOL
|
||||||
|
chmod ugo+rwx /usr/local/bin/clear-net-cache.sh
|
||||||
|
|
||||||
|
|
||||||
echo "Rejoining domain..."
|
echo "Rejoining domain..."
|
||||||
# kinit $ADMINUSER@${DCREALM,,}
|
# kinit $ADMINUSER@${DCREALM,,}
|
||||||
net ads join -U $ADMINUSER -S ${DCHOSTNAME,,}.${DCREALM,,}
|
net ads join -U $ADMINUSER -S ${DCHOSTNAME,,}.${DCREALM,,}
|
||||||
@ -165,12 +176,7 @@ smbcontrol smbd reload-config
|
|||||||
systemctl restart winbind
|
systemctl restart winbind
|
||||||
|
|
||||||
# Clear Winbind cache
|
# Clear Winbind cache
|
||||||
service winbind stop
|
/usr/local/bin/clear-net-cache.sh
|
||||||
service smbd stop
|
|
||||||
net cache flush
|
|
||||||
rm /var/lib/samba/*.tdb
|
|
||||||
service smbd start
|
|
||||||
service winbind start
|
|
||||||
|
|
||||||
echo "Found admin user:"
|
echo "Found admin user:"
|
||||||
getent passwd ${WORKGROUP^^}\\$ADMINUSER
|
getent passwd ${WORKGROUP^^}\\$ADMINUSER
|
||||||
|
Loading…
x
Reference in New Issue
Block a user