« 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
 
(4 versions intermédiaires par le même utilisateur non affichées)
Ligne 2 : Ligne 2 :
#!/usr/bin/env bash
#!/usr/bin/env bash


if [ ! -d /export/homes/$1 ]; then
TMP=$(echo $1 | grep -qE '_$')
HDIR="/export/homes/${1}"
if [ $_ -eq 0 ]; then
SUID=$(wbinfo --sid-to-uid $(wbinfo --name-to-sid $1 | awk '{print $1}'))
    exit 0
mkdir ${HDIR}
fi
chown ${SUID} ${HDIR}
 
chmod 700 ${HDIR}
if [ ! -d <répertoire_de_base>/$1 ]; then
    HDIR="<répertoire_de_base>/${1}"
    SUID=$(wbinfo --sid-to-uid $(wbinfo --name-to-sid $1 | awk '{print $1}'))
    mkdir ${HDIR}
    chown ${SUID} ${HDIR}
    chmod 700 ${HDIR}
fi
fi
</syntaxhighlight>
</syntaxhighlight>

Dernière version du 17 mars 2022 à 22:14

#!/usr/bin/env bash

TMP=$(echo $1 | grep -qE '_$')
if [ $_ -eq 0 ]; then
    exit 0
fi

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