mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 16:50:13 +01:00
Update ADconnection.sh
This commit is contained in:
parent
a3c5007d3d
commit
75c2058274
@ -871,9 +871,14 @@ fi
|
|||||||
########################################### Leave Realm ################################
|
########################################### Leave Realm ################################
|
||||||
|
|
||||||
leave(){
|
leave(){
|
||||||
echo "${NUMBER}This funktion only works properly if this computer can locate the domain${END}"
|
|
||||||
LEFT=$(sudo realm discover | grep configured | awk '{print $2}')
|
LEFT=$(sudo realm discover | grep configured | awk '{print $2}')
|
||||||
DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}')
|
DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}')
|
||||||
|
SSSD=$( sudo cat /etc/sssd/sssd.conf | grep domain | awk '{print $3}' | head -1 )
|
||||||
|
DOMAINlower=$( echo $DOMAIN | tr '[:upper:]' '[:lower:]' )
|
||||||
|
if [ "$DOMAINlower" = "$SSSD" ]
|
||||||
|
then
|
||||||
|
echo "Detecting realm $SSSD"
|
||||||
|
else
|
||||||
if [ "$LEFT" = "no" ]
|
if [ "$LEFT" = "no" ]
|
||||||
then
|
then
|
||||||
echo ""
|
echo ""
|
||||||
@ -881,6 +886,7 @@ DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}')
|
|||||||
echo ""
|
echo ""
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
read -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
|
read -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "Listing domain"
|
[Yy]* ) echo "Listing domain"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user