Cours:FixLegoLinux

De troyesGEII
Révision datée du 27 août 2019 à 09:32 par Bjacquot (discussion | contributions) (Page créée avec « <source lang=bash> #!/bin/bash if [ "$ACTION" = "add" ] then echo "+">>/tmp/testrules printenv >> /tmp/testrules fsck.vfat -aw $DEVNAME >> /tmp/te... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à : navigation, rechercher
#!/bin/bash

if [ "$ACTION" = "add" ]
then
        echo "+">>/tmp/testrules
        printenv >> /tmp/testrules
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        mount $DEVNAME /mnt/mountLego  >> /tmp/testrules
        rm -R /mnt/mountLego/*
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        umount $DEVNAME  >> /tmp/testrules
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        fsck.vfat -aw $DEVNAME >> /tmp/testrules
        sleep 0.1
        sync
        mount $DEVNAME /mnt/mountLego  >> /tmp/testrules
        rm -R /mnt/mountLego/*
        umount $DEVNAME  >> /tmp/testrules
elif [ "$ACTION" = "remove" ]
then
        echo "-">>/tmp/testrules
fi