Created
January 12, 2019 20:53
-
-
Save xorenio/17dbf5a9afef1a4f6bd88a7888f0aa41 to your computer and use it in GitHub Desktop.
create LDAP homes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##HOMES=$(getent passwd) | |
HOMES=$(sudo getent passwd | awk -F ":" '$7 == "/bin/bash" && $3 >= 2000 {print $1":"$6}') | |
for i in ${HOMES}; do | |
ARR=(${i//:/ }) | |
NAME=${ARR[0]} | |
HOME=${ARR[1]} | |
if [ ! -d ${HOME} ]; then | |
sudo mkhomedir_helper ${NAME} | |
fi | |
done | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment