What's a working example of modifying /etc/export using bash?
I want to ensure the following rule is present and valid:
And it should:
- Add only if it doesn't exist already (in any form)
- If it partly exists, it shold update existing entry (e.g options update)
Possible syntaxes in existing file:
Multiple whitespaces, and different options
Multiple allow on same line
/export/home 2400:123::/32(rw,no_root_squash,no_subtree_check) 2400:321::/32(rw,no_root_squash,no_subtree_check)
In addition to combinations of the above.
Initially I wanted to use augeas for this, but there's a bug with IPv6 adresses in the /etc/exports file.
The /etc/exports file should allow independent modifying witout breaking the script (which should ensure only the rule in question is correct and valid, and leave the rest of the rules alone)