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
1db1e8b52b
commit
038648c91d
@ -1259,16 +1259,6 @@ fi
|
|||||||
|
|
||||||
############################### Reauth ##########################################
|
############################### Reauth ##########################################
|
||||||
Reauthenticate(){
|
Reauthenticate(){
|
||||||
whoelse=$( who -ut | grep -v old | awk '{print $1}' )
|
|
||||||
homes=$( ls /home/tobii.intra/ )
|
|
||||||
if [ "$homes" = "$whoelse" ]
|
|
||||||
then
|
|
||||||
echo ""
|
|
||||||
echo "you are logged in as an AD user.. canceling request"
|
|
||||||
echo "only administrator has permissions"
|
|
||||||
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 )
|
||||||
@ -1326,16 +1316,6 @@ fi
|
|||||||
|
|
||||||
########################################### Leave Realm ################################
|
########################################### Leave Realm ################################
|
||||||
leave(){
|
leave(){
|
||||||
whoelse=$( who -ut | grep -v old | awk '{print $1}' )
|
|
||||||
homes=$( ls /home/tobii.intra/ )
|
|
||||||
if [ "$homes" = "$whoelse" ]
|
|
||||||
then
|
|
||||||
echo ""
|
|
||||||
echo "you are logged in as an AD user.. canceling request"
|
|
||||||
echo "only administrator has permissions"
|
|
||||||
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