# Root check if [[ $UID != 0 ]]; then echo 'Vous devez utiliser ce programme sous root, ou avec sudo' exit 1 fi # Simple command line argument for installers # -w: mount them with user,umask=0111 # -r: mount them with user,umask=0133,uid=1000,gid=1000 RWALL=-1; if [[ $1 == '-w' ]]; then RWALL=1; fi if [[ $1 == '-r' ]]; then RWALL=0; fi if [[ $RWALL == -1 ]]; then echo 'Par defaut seul root pourra écrire sur le disque et' cat /etc/passwd | awk -F ':|,' '/:1000:/ {print $5 " (" $1 " )"}' echo 'l,écriture sur les disques doit-elle être autorisée à tous les utilisateurs ? (y/n)' read RESP if [[ $RESP == 'y' || $RESP == 'Y' ]]; then RWALL=1 else RWALL=0 fi fi if [[ $RWALL == 1 ]]; then OPTIONS='user,fmask=0111,dmask=0000' MACOPTIONS='user,file_umask=0111,dir_umask=0000' else OPTIONS='user,fmask=0133,dmask=0022,uid=1000,gid=1000' MACOPTIONS='user,file_umask=0133,dir_umask=0022,uid=1000,gid=1000' fi # Now for the real work drivesntfs=`fdisk -l | grep -i 'ntfs' | awk -F '/| ' '{print $3}'` drivesfat=`fdisk -l | grep -i 'fat32' | awk -F '/| ' '{print $3}'` driveshfs=`fdisk -l | grep -i 'Apple_HFS' | awk -F '/| ' '{print $3}'` usefuse=no test -r /etc/lsb-release && source /etc/lsb-release if [[ "x$DISTRIB_RELEASE" == "x6.04" || "x$DISTRIB_RELEASE" > "x6.04" ]]; then echo "Sur Ubuntu Dapper Drake le support en écriture sur NTFS peut être fait " echo "avec le module très experimental NTFS FUSE . Il semble fonctionner mais " echo -n "n'est PAS RECOMMANDE. Voulez-vous l'utiliser ? [no] " read RESP if [[ $RESP == 'yes' ]]; then usefuse=yes echo "Enabling experimental NTFS write support" else echo "Not enabling experimental NTFS write support" fi fi
|