Just tested your script. It works nicely, when devices are plugged in to a running system. But when already plugged in at boot, they don`t get mounted at all, although it might be, that I made a mistake somewhere, by perhaps placing it on the wrong place in bootlocal.sh? Could someone please recheck this?
By plugging in while system is running, it mounts ntfs, fat16 and fat32 without problems as rewritable.
EDIT:
For anyone willing to use the above script by Rich, here is the working umount script:
#!/bin/sh
for i in $(cat /etc/fstab | grep $1 | cut -c 6-9) ## create correct variable i in case partition number is missing
do
[ -z $i ] && continue
umount /mnt/$i
sleep 1
rmdir /mnt/$1
rebuildfstab
done
Edit as of "my brain came back"
But when already plugged in at boot, they don`t get mounted at all
Well, stupid me, of course it won't get mounted .... lol!!! Sorry!!