Allow overriding default settings with local option/config file
Much like a lot of UNIX tools support, I'd like to be able to override script defaults with a local configuration file. That way some servers can report to a specific address and others can report to yet another address, or as may be appropriate an entirely different category. This could be used for example where patching duties vary between boxes and using a different category causes the scraped email to be assigned to a different group.
We can either have the script include a very specific file or it can look in order for a selection of files to import. MySQL for example supports importing from multiple files with the last one having the greatest precedence.
. Perhaps one of these locations?
Opted to allow an array of locations for the override file to be included. I ran into at least one situation where having it in the same directory as the script would have been handy.
- Fixed typo
- Fixed logic used to get the path to the script (for include file reference) if script is called via a symbolic link
Light testing so far shows this to work well.
#7 Updated by Deoren Moor over 3 years ago
Deoren Moor wrote:
Note: The script need to confirm permissions are sane before including the file.
Note sure yet which of:
would be appropriate here. I'm leaning towards the second?
I think I'll split this out into a separate feature. From what I've seen of init.d scripts (at least on Ubuntu), they don't check permissions or ownership before including them during script execution.