This is the old SliTaz forum - Please use the main forum.slitaz.org

Scripts de montage automatique partitions NTFS - Automount ntfs partitions ntfs-3g
  • kiki67100kiki67100 September 2010
    Bonjour,
    Un script que j'ai mis sur ma clef pour le montage automatique des partitions ntfs.
    Mon script n'est pas parfait, mais peut-être que ça peut servir à quelqu'un

    #!/bin/sh


    if [ `whoami` != "root" ];
    then
    echo 'Must be root !'
    su -c "`pwd`/$0" - root
    read
    exit
    fi

    for device in `fdisk -l | awk '{ print $1 }' | grep dev`; do #Extract
    dev=`printf $device | cut -d "/" -f3` # Extract /dev/$dev
    mkdir "/media/$dev" -p;
    printf "> Montage de $device sur /media/$dev :"

    if [ "$(ntfs-3g $device /media/$dev &>/dev/null)" -eq "0" ]; then
    printf " OK\n"
    else
    printf " Erreur\n";
    fi
    done

    read -p " Montage termine, appuyer pour continuer"
    su -c "pcmanfm /media" - tux
    exit # Bye

    Cordialement Kevin
  • kiki67100kiki67100 September 2010
    http://pastebin.com/SgjPf6Vt
    *Avec l'indentation

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social