autofs
has a auto.master
configuration file that assignes maps files to paths, and in these maps files we can define how to mount subdirectories of the paths from auto.master
. These subdirectories can be explicit or we can use *
which becomes a wildcard(which we can refer to in the mount options using &
). Additionally, if we make a maps file executable it will receive that subdirectory as it's first(and only) argument, and be expected to write the mount definition to stdout.
Now, my problem is that I need 2 wildcards/arguments. I want that if someone tries to access /mymount/<foo>/<bar>
, where <foo>
and <bar>
can be any legal file names, it will create a mountpoint on /mymount/<foo>/<bar>
to a target that depends on both <foo>
and <bar>
. My problem is that the I can only use one wildcard(which is <foo>
), and with the executable maps file approach the argument I get is just <foo>
and I autofs
expects me to return mount options that will be mounted on /mymount/<foo>
.
Is what I want even possible with autofs
? I can easily find docs for a single parameter, but nothing about using multiple parameters...