initial commit

This commit is contained in:
bytewerk 2015-05-17 04:26:38 +02:00
commit b4501dd6ea
2 changed files with 16 additions and 0 deletions

15
mountUSB.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
device=$1
if [ ${#device} -gt "3" ]; then
label=$(blkid "/dev/$device" -s LABEL -o value)
if [ ${#label} -gt "0" ]; then
mountName="$label"
else
mountName="$device"
fi
fi
mkdir -p "/media/$mountName"
mount -o ro "/dev/disk/by-uuid/$(blkid "/dev/$device" -s UUID -o value)" "/media/$mountName"
echo "Mounted $(blkid "/dev/$device" -s UUID -o value) to $mountName inside media"

1
udev.rule Normal file
View File

@ -0,0 +1 @@
ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="sd*", RUN+="/root/mountUSB.sh %k"