Update ADconnection.sh

This commit is contained in:
PierreGode 2018-08-24 09:35:39 +02:00 committed by GitHub
parent 9b4a334c7e
commit 925351c409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1323,7 +1323,7 @@ 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 echo "only administrator has permissions"
echo "" echo ""
exit exit
else else
@ -1347,7 +1347,7 @@ 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"
sudo realm discover $DOMAIN sudo realm discover $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}')
if [ "$LEFT" = "no" ] if [ "$LEFT" = "no" ]
then then
@ -1358,7 +1358,7 @@ read -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
else else
echo "something went wrong, try to leave manually" echo "something went wrong, try to leave manually"
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}')
if [ "$left" = "no" ] if [ "$left" = "no" ]
then then