in reply to Re^3: why does perl-suid not mount
in thread why does perl-suid not mount

That was a great hint. I modified the script to check for $SUDO_UID and it runs like a charm.

Thanks a lot.

After tidying it up, I'll put it on github in case anybody faces similar challenges.