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

De Adadov.net wiki
(Page créée avec « <syntaxhighlight lang="bash" line="line"> #!/usr/bin/env bash if [ ! -d /export/homes/$1 ]; then HDIR="/export/homes/${1}" SUID=$(wbinfo --sid-to-uid $(wbinfo --name-to… »)
 
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
    exit 0
fi


if [ ! -d /export/homes/$1 ]; then
if [ ! -d /export/homes/$1 ]; then
HDIR="/export/homes/${1}"
    HDIR="/export/homes/${1}"
SUID=$(wbinfo --sid-to-uid $(wbinfo --name-to-sid $1 | awk '{print $1}'))
    SUID=$(wbinfo --sid-to-uid $(wbinfo --name-to-sid $1 | awk '{print $1}'))
mkdir ${HDIR}
    mkdir ${HDIR}
chown ${SUID} ${HDIR}
    chown ${SUID} ${HDIR}
chmod 700 ${HDIR}
    chmod 700 ${HDIR}
fi
fi
</syntaxhighlight>
</syntaxhighlight>

Version du 17 mars 2022 à 22:07

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