DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-11-18 12:35:56

akleiw
New member
Registered: 2011-11-18
Posts: 1

Run a script when a USB device is plugged in.

Hi,
Using instructions from this post I got my DNS-320 to load firmware to HP 1018 printer when the NAS boots up.

Now I'd like to run the script, that loads the firmware, whenever the printer is plugged-in / powered on. So far I can think of either a loop that sleeps 30sec and then polls lsusb to look for printer or a cron job, which essentially does the same thing.

Are there any more elegant methods to trigger a script when a printer is connected?

Offline

 

#2 2011-11-18 14:01:01

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Run a script when a USB device is plugged in.

If the 320 runs udevd, you could use an udev rule to start your script.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB