Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/coderofsalvation/udev-autorun

udev rule + utility which automatically runs a shellscript on drives when plugged in (or asks for action like windows)
https://github.com/coderofsalvation/udev-autorun

Last synced: 12 days ago
JSON representation

udev rule + utility which automatically runs a shellscript on drives when plugged in (or asks for action like windows)

Awesome Lists containing this project

README

        

udev-autorun
============

udev rule which automatically runs a shellscript on drives when plugged in (or asks for action like windows)

### WHY ###

I wanted a idiotproof way to just run scripts on pluggable drives (aka the infamous autorun).
Udev seems very attractive at first, but before you know many hours are spent to figure out this beast.
I use many sd/smartmedia cards while Im making music with my hardware devices, so I wanted synchronisation and other
repetitive tasks to be automated: sometimes automatically, sometimes optional.

This is a simple shellscript which facilitates all this.

### HOW ###

With `udev-autorun` you can just add several autorun scripts on your usb device, and automatically run or prompt tasks to the user. Its modular so the possibilities are unlimited

### INSTALL / GETTING STARTED ###

Do the following as *nonroot* user with sudo-privileges:

git clone https://github.com/coderofsalvation/udev-autorun.git
cd udev-autorun
./install.sh

Now start adding an example autorunmodule to your drive 'MySDCard'

udev-autorun init /media/MySDCard example

Now re-plugin your usb stick and see what happens.
If you are not running an graphical webenvironment (homeserver/headless) all modules are executed, else
you will see something like this:

This means you can choose which action you want to perform, or just simply exit.

### EXAMPLE APPLICATIONS ###

* automatically copy pdf's from a certain folder to your ebook (upon connect)
* automatically copy mp3's from a certain folder to your mp3player
* automatically gather stats from internet and write as html/pdf to your ebook/hpc/etc
* automatically backup files from your usbdrives/flashcard to your harddrive
* automatically copy samples from your harddrive to your flashcard (for liveacts etc)
* trigger your coffeemachine when somebody plugs in a special usbdevice

### CONCLUSION ###

Udev-autorun is your portal to bash shellscripting which really makes the unthinkable possible.