Config:Samba4-script-homedrive
#!/usr/bin/env bash
if grep -qE '_$' $1; then
exit 0
fi
if [ ! -d /export/homes/$1 ]; then
HDIR="/export/homes/${1}"
SUID=$(wbinfo --sid-to-uid $(wbinfo --name-to-sid $1 | awk '{print $1}'))
mkdir ${HDIR}
chown ${SUID} ${HDIR}
chmod 700 ${HDIR}
fi