#!/bin/bash
# Mounts usbpendrive using usb-mount
                                                                
USBMOUNT=/usr/local/bin/usb-mount                                               
# Unfortunately udev only creates the device nodes AFTER this script is run.    
# We sleep for 2 seconds in the background and then run usb-mount. This will    
# mount the device.                                                             
(sleep 2 && $USBMOUNT) &                                                        
# Install usb-mount as the script that is run when the device is removed.       
# This will automatically unmount the filesystem.                               
ln -s $USBMOUNT $REMOVER
