#!/bin/bash
# /etc/udev/rules.d/mymkdirlnk.sh last edited 2020-03-14

# translate a property to the mountpoint name.
# properties are, in order:
# ID_SERIAL_SHORT
# quit after any success.

cd /etc/udev/rules.d/my-mountpoints/ || exit
[ ! -f "$ID_SERIAL_SHORT" ] && exit
Mntpnt="$(cat "$ID_SERIAL_SHORT")"
Link="${Mntpnt:0:-1}"
cd /media
mkdir "$Mntpnt" || exit
[ ! -e "$Link" ] && ln -s "$Mntpnt" "$Link"

#
