« Config:Samba4-script-homedrive » : différence entre les versions

De Adadov.net wiki
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
<syntaxhighlight lang="bash" line="line">
<syntaxhighlight lang="bash" line="line">
#!/usr/bin/env bash
#!/usr/bin/env bash
if grep -qE '_$' $1; then
if grep -qE '_$' $1; then
     exit 0
     exit 0

Version du 17 mars 2022 à 22:08

#!/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