This page is primarily for freetz package developers.
Freetz provides a package configuration framework easing implementation and allows settings to be stored persistently. Packages must provide two files to use the framework:
/etc/default.$package/$package.cfg — This file must contain all configuration settings as exported shell variables; each variable has to start with the capitalized package name. Example:
export PACKAGE_VAR1='var1' export PACKAGE_VAR2='var2'
If this is implemented correctly, freetz takes care of saving and also restarting the service, if the package provides one.
Freetz also provides a mechanism to hook into the ‘normal’ saving procedure and execute custom code or do manual saving. An example using this mechanism is the package mini_fo. This mechanism comes in quite handy if the package needs to re-create configuration files or start/stop special (non-default) services on changing the configuration. It works as follows: If a package provides a file /etc/default.$package/$package.save, it will be sourced by the saving mechanism as a shell script (but it should not have a shebang line!). The .save-script can implement any or all of the following shell functions, which are executed at some special point during the saving mechanims: