Update ADconnection.sh

This commit is contained in:
PierreGode 2018-08-08 10:43:54 +02:00 committed by GitHub
parent 0d589cb865
commit 0122f4c912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -893,14 +893,14 @@ read -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
echo "" echo ""
whoelse=$(who | head -1 | awk '{print $1}') whoelse=$(who | head -1 | awk '{print $1}')
homes=$( ls /home/tobii.intra/ ) homes=$( ls /home/tobii.intra/ )
if [ "$homes" = "$whoelse" ] #if [ "$homes" = "$whoelse" ]
then #then
echo "" #echo ""
echo "you are logged in as an AD user.. canceling request" #echo "you are logged in as an AD user.. canceling request"
echo "only administrator has permissions" 3echo "only administrator has permissions"
echo "" #echo ""
exit #exit
else 3else
sudo echo "" | sudo tee /etc/sssd/sssd.conf sudo echo "" | sudo tee /etc/sssd/sssd.conf
echo "$DOMAIN has been left" echo "$DOMAIN has been left"
linuxclient linuxclient
@ -909,7 +909,7 @@ else
read -r DOMAIN read -r DOMAIN
sudo realm leave $DOMAIN sudo realm leave $DOMAIN
left=$(sudo realm discover | grep configured | awk '{print $2}') left=$(sudo realm discover | grep configured | awk '{print $2}')
fi
if [ "$left" = "no" ] if [ "$left" = "no" ]
then then
echo "" echo ""