mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 16:50:13 +01:00
small fixes
This commit is contained in:
parent
eeda9bd88d
commit
048e0892cf
@ -1454,32 +1454,6 @@ exit
|
|||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
############################## Chech User ######################################3
|
|
||||||
checkuser(){
|
|
||||||
clear
|
|
||||||
export HOSTNAME
|
|
||||||
myhost=$( hostname | cut -d '.' -f1 )
|
|
||||||
DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}' | tr "[:upper:]" "[:lower:]")
|
|
||||||
if [ -z "$2" ]
|
|
||||||
then
|
|
||||||
if [ -d /home/"$DOMAIN" ]
|
|
||||||
then
|
|
||||||
ls /home/"$DOMAIN"/ | while read -r user
|
|
||||||
do
|
|
||||||
id "$user"
|
|
||||||
echo "___________________________________________________________________________"
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
else
|
|
||||||
echo "no user found on this system. try typing the user:"
|
|
||||||
read -r user
|
|
||||||
id "$user" | grep "$myhost"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
id "$2"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
################################## info ##################################
|
################################## info ##################################
|
||||||
readmes(){
|
readmes(){
|
||||||
@ -1710,8 +1684,29 @@ while test $# -gt 0; do
|
|||||||
;;
|
;;
|
||||||
-u|--u)
|
-u|--u)
|
||||||
if test $# -gt 0; then
|
if test $# -gt 0; then
|
||||||
checkuser
|
clear
|
||||||
exit
|
export HOSTNAME
|
||||||
|
myhost=$( hostname | cut -d '.' -f1 )
|
||||||
|
DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}' | tr "[:upper:]" "[:lower:]")
|
||||||
|
if [ -z "$2" ]
|
||||||
|
then
|
||||||
|
if [ -d /home/"$DOMAIN" ]
|
||||||
|
then
|
||||||
|
ls /home/"$DOMAIN"/ | while read -r user
|
||||||
|
do
|
||||||
|
id "$user"
|
||||||
|
echo "___________________________________________________________________________"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "no user found on this system. try typing the user:"
|
||||||
|
read -r user
|
||||||
|
id "$user" | grep "$myhost"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
id "$2"
|
||||||
|
fi
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
-o|--o)
|
-o|--o)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user