You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
404B

  1. #!/bin/sh
  2. device=$1
  3. if [ ${#device} -gt "3" ]; then
  4. label=$(blkid "/dev/$device" -s LABEL -o value)
  5. if [ ${#label} -gt "0" ]; then
  6. mountName="$label"
  7. else
  8. mountName="$device"
  9. fi
  10. fi
  11. mkdir -p "/media/$mountName"
  12. mount -o ro "/dev/disk/by-uuid/$(blkid "/dev/$device" -s UUID -o value)" "/media/$mountName"
  13. echo "Mounted $(blkid "/dev/$device" -s UUID -o value) to $mountName inside media"