#!/bin/bash

# USB-Stick mounten
sleep 5
device=`dmesg | grep -e sd.: | tail -n 1 | sed -n 's/.*sd.:\s\+\?\(.*\)/\1/i p'`
name=`dmesg | grep -i product: | tail -n 1 | sed -n 's/.*product:\s\+\(.*\)/\1/i p' | sed -n 's/\ /_/g p'`

if [ ! -d /media/$name ]; then 
    mkdir /media/$name
fi
mount /dev/$device /media/$name 
