f



execute shell script on USB hotplug

I would like to execute a shell script when a user plugs in a USB
storage device so I can automate the process of adding and removing
MP3s and other files.

The machine this is running on will be used only for adding and
removing MP3 files from USB storage, and will have a web-based GUI, if
that makes a difference.  (This will be a publically accessable kiosk)

I was hoping to find some more details on using the hotplug system
and/or udev in the hardware section.  Any ideas?

0
10/28/2005 1:59:21 PM
comp.os.linux.hardware 9616 articles. 0 followers. Post Follow

1 Replies
397 Views

Similar Articles

[PageSpeed] 34

On 28 Oct 2005 06:59:21 -0700, oneseventeen@gmail.com staggered into the
Black Sun and said:
> I would like to execute a shell script when a user plugs in a USB
> storage device so I can automate the process of adding and removing
> MP3s and other files.

This sounds like a recipe for disaster to me.  What if the user's device
has a weird directory structure, a weird filesystem, or only 500K free?
Most automated processes like the ones you describe must make a large
number of assumptions, and if their assumptions aren't correct, they
tend to fail in interesting and stupid ways.  (Been There, Done That,
Got The T-Shirt.)

> I was hoping to find some more details on using the hotplug system

/etc/hotplug/ should contain a bunch of files that have a bunch of
comments in them.  On my Gentoo system, /etc/hotplug/usb/usbcam is a
shell script that executes when a USB camera that matches a large list of
device IDs is plugged in.  This script just does a chmod/chown to the
camera's device node so the currently-logged-in user can do stuff, but
it could be rearranged to do other things.  "man 8 hotplug" may also
provide info on the guts of the hotplug system.  HTH,

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /    "He is a rhythmic movement of the
-----------------------------/      penguins, is Tux." --MegaHAL
0
10/28/2005 4:56:58 PM
Reply:

Similar Artilces:

execute a shell script in a shell script
Please help. I have been stumbled on this issue, please see below. I am unable to execute a shell script in a shell script. I need to use perl script but not others and have tried eval, -exec and other on perl script but failed. system"cleartool setview -exec \"cleartool describe -fmt 'On %Sd modified %En and comment:\n %c\n\n' /myproject/vob/myprogram.C\" my_lag "; tks. On Dec 3, 8:30 am, moongeegee <moongee...@gmail.com> wrote: > Please help. > I have been stumbled on this issue, please see below. I am unable to > execute a shell script in a shel...

handling SIGINT in shell scripts when executing another shell script.
I have a simple shell script foo1.sh that invokes another shell script foo2.sh, something like below: #!/bin/sh SIGINT_handler() { echo "## [$DATE_TIME] User interrupt ignored," continue } trap SIGINT_handler 2 .... ../foo2.sh .... ---------- while executing foo1.sh, if the script receives SIGINT, how do I ignore the SIGINT in foo2.sh ? somehow foo2.sh does not finish to completion and is killed after receiving SIGINT. but foo1.sh is still executing. Is there any way to trap this signal in the child script. ? Please share your thots and inputs on this topic. Regards, Vikram S...

Execute Linux shell scripts from Paradox!
Execute Linux shell scripts from Paradox running on Linux under Wine! I have put together a Form that demonstrates How-to execute Linux shell scripts from Paradox. The Form also demonstrates How-to write, then execute Linux shell scripts from Paradox. This also deals with managing file permissions from within Paradox! This is a major breakthrough for anyone considering Paradox on Linux. This means that Paradox can engage in two-way communications directly with Linux and circumvent the Wine system. All of the Forms functions will run on a Linux PC, while only the Help functio...

execute shell script on remote linux machine
Hi All Is there something other than telnet that will allow me to non-interactively execute commands on a remote UNIX system? is there any step by step manual I can use in order to configure ssh to do that ? Any help would be appreciated, Thanks in advance Amir asulin ...

How to execute shell script in Firefox Linux web browser
I am having a problem with Firefox for Linux version 2.0.0.6 When my HTML application calls shell file to execute (just to echo some information) Firefox and Linux ask me what application I want to run with it (" You have chosen to open <file>.sh which is a : shell script from / srv/www/cgi-bin. What should Firefox do with this file?") I just want to display echo on Firefox web browser main window. What should I do ? My Apach eis running, my files are 755 mode and in directory /srv/www/ cgi-bin, so it should be fine. Thx in advance, Lalo On Wed, 09 Apr 2008 18:52:02 -07...

OS X Terminal Shell Script Execution Path
Hey All, Can someone tell me how to query the path from which a terminal shell script is being executed? I've written a simple install script that copies files. I have written my script as text, saved it with the .command extension and set chmod 775. When I run the command, it works fine however there is one big problem.... the path that it is executing from is not the same as where the command file lives on disk. The file is located in a folder on the desktop and the source files I want to copy are within a subdirectory. I need the script to work no matter where it is placed, as long a...

executing linux shell script from within c++.net
Hi, I'm trying to use a .net windows application within linux, using WINE, to run a shell script. The reason is that I need to use linux's dd command on a ext2 filesystem that's on an external drive, and .net doesn't seem to support this, and I don't want to rewrite my entire application for linux just to use this command. Should system("script") work? right now, when I try that, system() is returning 0, which I presume means that the script isn't being called properly. Any help would be very much appreciated. Thanks, John jaywelbourn@gmail.com wrote: ...

execute a shell script from a python script
Hi all, I know nothing about Python. What I need to do is to get a Python script to execute a local shell script. I do not need any output. What would be th eeasiest way to accomplish this? Thanks! If your script is foo.sh and takes args: import subprocess subprocess.call(["foo.sh","args"],shell=True) Should work fine. check out http://www.python.org/dev/doc/maint24/lib/module-subprocess.html Enjoy, THN spec wrote: > Hi all, I know nothing about Python. What I need to do is to get a > Python script to execute a local shell script. I do not need any > output. ...

Execute shell script from a perl script
Hi, How can I executed a Unix shell script from a Perl script. The shell script is a dump of a oracle table to a file. The perl script is for the reformat of this output file. Thanks Karel J. Gleixner wrote: > kderaedt wrote: > >> Hi, >> >> How can I executed a Unix shell script from a Perl script. >> The shell script is a dump of a oracle table to a file. The perl >> script is >> for the reformat of this output file. > > perldoc -f system > Or if your perl script takes input from STDIN, and you modified your shell script...

How to use Windows 2000 to execute shell script on remote linux machine
Hi All, Does anyone know what is the best secured option I've got in order to achive th above ? Is there any ssh step by step configuration guide ? Thanks in advance, Amir asulin asulin@bigfoot.com ...

Mac OS X File Association Meta Data Shell Script Execution
http://secunia.com/advisories/18963/ Description: Michael Lehn has discovered a vulnerability in Mac OS X, which can be exploited by malicious people to compromise a user's system. The vulnerability is caused due to an error in the processing of file association meta data in ZIP archives (stored in the "__MACOSX" folder) and mail messages (defined via the AppleDouble MIME format). This can be exploited to trick users into executing a malicious shell script renamed to a safe file extension stored in a ZIP archive or in a mail attachment. This can also be exploited automat...

Execution of SQL Script thru shell script
hi all, I have a piece of SQL code(some insert statement). Unix server. Oracle DB. I need to execute the sql code in the unix shell ... as in as a part of a batch process... i have a loginid password... for oracle i believe that there is some sql command that can be embeded in the shell script ? ne one aware ? something like sqlplus username/password ... statement to execute sql file... i need exact syntax... Any help is appreciated ! regards iveanid@yahoo.com (Sridhar) writes: > I have a piece of SQL code(some insert statement). Unix > server. Oracle DB. I need to execute the s...

Terminate a python script from linux shell / bash script
Hello :-) I have a question about Python and Linux shell. I have a python program whi= ch is permanently resident in the end-user system. I'm currently producing = a RPM package=2C and it works nicely. The problem is that when I uninstall = it=2C my program keeps running in the background=2C even if the files are d= eleted. I know I can terminate python shell directly=2C but this is not a good idea= because the end-user may be working with another important python applicat= ion=2C and would be very angry if mine would close everything that is using= python shell. So=2C is there a way...

shell script with awk line that doesnt execute a further shell command
Hi Newbie-question. These lines work if executed from shell. wget -O "16" http://jumpcgi.bger.ch/cgi-bin/JumpCGI?id=03.08.2006_1P.455/2006 | sh wget -O "1" "http://jumpcgi.bger.ch/cgi-bin/JumpCGI?id=20.06.2006_K_28/06" | sh But within my bash-script it doesnt work. So there might be some escape sequence problems. The line is "produced" from a awk line in a bash script: awk -F[=\"\<\>] ' BEGIN { zaehler=0; } /HREF/ && /bger/ && /jump/ { link=$5 "=" $6; dnr=$6; zaehler++; print "wget -O " "\...

Web resources about - execute shell script on USB hotplug - comp.os.linux.hardware

Execute (album) - Wikipedia, the free encyclopedia
Execute is the debut album of So Solid Crew members, Oxide & Neutrino . It includes the Casualty sampling number 1 single " Bound 4 Da Reload ...

eXecute by J.P. Morgan on the App Store
Read reviews, compare customer ratings, see screenshots, and learn more about eXecute by J.P. Morgan. Download eXecute by J.P. Morgan and enjoy ...

Occupy Wall Street Protester Wants To Execute "White Collar Criminals" - YouTube
A protester at Occupy Wall Street tells National Review's Charles C. W. Cooke that he wouldn't want to be president because of his "dark side," ...

Taliban gunman publicly executes woman near Kabul
A man, Afghan officials say is a member of the Taliban, shot dead a woman accused of adultery in front of a crowd near Kabul, a video obtained ...

How Indonesia will execute death row inmates
Bali Nine drug traffickers Andrew Chan and Myuran Sukumaran will have some small choices in the way they die and those who execute them will ...

Pakistan to execute 500 terror convicts
Pakistan plans to execute about 500 militants in coming weeks after the government lifted a moratorium on the death penalty in terror cases following ...

North Korea 'executes' leader's ex (00:47)
According to South Korean reports, the ex-girlfriend of North Korean leader Kim Jong-un was put to death on pornography allegations.

Mentally ill Brazilian Rodrigo Gularte fit to execute: Indonesia
A Brazilian man whom the Attorney-General has proclaimed fit to execute with the Bali nine organisers was first diagnosed with a mental illness ...

Somalia executes Aden Sheikh Abdi for the murder of journalist Hassan Yusuf Absuge
SOMALIA has executed a man who was convicted of murdering a journalist, a military official said, the first such execution in a country where ...

Fury as Indonesia executes foreigners
The execution of five foreign nationals in Indonesia has caused outrage in countries who had pleaded for clemency for their citizens.

Resources last updated: 2/3/2016 12:07:09 AM