mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Update ADconnection.sh
This commit is contained in:
parent
038648c91d
commit
9b4a334c7e
@ -1316,6 +1316,17 @@ fi
|
|||||||
|
|
||||||
########################################### Leave Realm ################################
|
########################################### Leave Realm ################################
|
||||||
leave(){
|
leave(){
|
||||||
|
whoelse=$( who -ut | grep -v old | awk '{print $1}' )
|
||||||
|
homeshome=$( sudo realm list | grep domain-name | awk '{print $2}' )
|
||||||
|
homes=$( ls /home/$homeshome | head -1 )
|
||||||
|
if [ "$homes" = "$whoelse" ]
|
||||||
|
then
|
||||||
|
echo ""
|
||||||
|
echo "you are logged in as an AD user.. canceling request"
|
||||||
|
echo "only administrator has
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
else
|
||||||
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 )
|
SSSD=$( sudo cat /etc/sssd/sssd.conf | grep domain | awk '{print $3}' | head -1 )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user