asparion
(usa Ubuntu)
Enviado em 22/10/2013 - 12:02h
[*****] QUE PARIUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
fiz o seguinte
conforme orientado
Criei o arquivo /etc/udev/rules.d/automount.rules e dentro dele:
# automounting usb flash drives
# # umask is used to allow every user to write on the stick
# # we use --sync in order to enable physical removing of mounted memory sticks -- this is OK for fat-based sticks
# # I don't automount sda since in my system this is the internal hard drive
# # depending on your hardware config, usb sticks might be other devices than sdb*
ACTION=="add",KERNEL=="sdb*", RUN+="/etc/scripts/pendrive.sh --sync --umask 000 %k"
ACTION=="remove", KERNEL=="sdb*", RUN+="/etc/scripts/pendrive.sh %k"
ACTION=="add",KERNEL=="sdc*", RUN+="/etc/scripts/pendrive.sh --sync --umask 000 %k"
ACTION=="remove", KERNEL=="sdc*", RUN+="/etc/scripts/pendrive.sh %k"
meu script
vim /etc/scripts/pendrive.sh
#!/bin/bash
#assim que conetcar o pendrive o script inicia
# CRIANDO PASTA PARA ACESSAR PENDRIVE
mkdir /home/pendrive
# montando o pendrive na pasta
mount -t vfat /dev/sdb1 /home/pendrive -o umask=0000
# quando desconectar o pendrive
rm -rf /home/pendrive
# fim do script
consegui acessar deu certo mas apagou todos meus arquivos kkkkkkkkkkkkkkkkk vou morrerrrrrrrrrrrrrrrr
obs: ainda bem que fiz backup antes de testar