If you don't mind my asking...
No, I don't mind :-). Google for "Bavaria". How did you know? By my accent or due to the fact that I wear lederhosen, a ridiculous hat and have a krauty smell?
Is this Long Island location true? I've been to the states just once, more than 20 years ago, to a place about 200 miles west of Chicago.
Thank you for the detailed explanation of the used commands and rules. I've never been a lot into scripting, use it once in a while, find it quite interesting and usually nick my code snippets from the web :-)!
Still, the script doesn't do as expected and I don't know why. Executed from cmd it works, if provided with sdb sdb1 or whatever. If run by udev, it does not. %k and $i, when echoed to a file turn out to be correct, fstab is created, mountpoint is created, but the drive fails to be mounted.
Normally I would expect the script to stay in a loop as long as sdb1 is not found in mtab, but ps -A doesn't show it. So I replaced the mount command by an echo "nonono >> /tmp/nono.txt" and this file is written (once). So the mount command for some reasons would be executed (even if it returns some kind of error) but whatever happens after that, I don't know. It should stay in a loop, until mtab has changed, shouldn't it? So normally, nono.txt would be filled up with nononos forever, but this also doesn't happen.
Even if I replace the $i with sdb1, it doesn't get mounted. So your script (which is quite a cool and very short piece of work as I have to admit) is definitely working but we are for unknown reasons not able to execute the mount command this way. What I do not understand is, why it does work, when executed by cmdline...
Frustrating, isn't it??!!