OpenWrt Forum Archive

Topic: hotplug script for specific device

The content of this topic has been archived on 18 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I want to write a hotplug script ONLY for my usb pen. for example i want to mount usb pen to /mnt/fdisk directory.


SCSI emulation for USB Mass Storage devices
  Vendor: Kingston  Model: DataTraveler 2.0  Rev: PMAP
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
SCSI device sdb: 1953792 512-byte hdwr sectors (1000 MB)
sdb: Write Protect is off
/dev/scsi/host1/bus0/target0/lun0: p1

I dont know how can you recognize that THIS device was plugged

parse the line starting with vendor (and model) if they match, mount it

the question is how. I am newbie... Please write here an example.

i'm about as experienced scripting in linux as a ten year old is with sex, heh

I'm sure someone around here can give some examples. You can search for examples using awk and bash scripting (although ash is more limited than bash, so look for those examples using ash (busybox's built in shell) instead of bash.

The discussion might have continued from here.