airflow
Contributor
- Joined
- May 29, 2014
- Messages
- 111
Hi! What is the best way to store/retrieve system wide variables which can be then used in scripts?
Background to this question is that I have written some helpful scripts for my FreeNAS, which I now also want to use on some other FreeNAS systems. Some variables have to be different and therfore tweaked between these systems. Instead of editing the scripts themselves, I'd like to keep the scripts exactly same (and manage with git), and change the variables via some other means.
Could I use the "tunables" for this? That would be awesome, because then I could change those via GUI. If yes, which of the three is suitable best? And how can I read it out? My idea would be to use the "SYSCTL"-type of tunable, and then read it out via "sysctl -b <varname>". Any better ideas?
Background to this question is that I have written some helpful scripts for my FreeNAS, which I now also want to use on some other FreeNAS systems. Some variables have to be different and therfore tweaked between these systems. Instead of editing the scripts themselves, I'd like to keep the scripts exactly same (and manage with git), and change the variables via some other means.
Could I use the "tunables" for this? That would be awesome, because then I could change those via GUI. If yes, which of the three is suitable best? And how can I read it out? My idea would be to use the "SYSCTL"-type of tunable, and then read it out via "sysctl -b <varname>". Any better ideas?