Add a parameter for indent in config_section_open and
config_section_close. Previously you had to separately add indents
while parsing if a section was inside another section.
Now this is supported by these two functions.
You can specify how much indent you need to add before opening or closing
a section.
Signed-off-by: Rishabh <redacted>
config_section_open() {
local tag="$1"
local name="$2"
+ local indent="$3"
+ [ -n "$indent" ] && printf '%b' "$indent" >> "$KEEPALIVED_CONF"
printf '%s' "$tag" >> "$KEEPALIVED_CONF"
[ -n "$name" ] && printf ' %s' "$name" >> "$KEEPALIVED_CONF"
printf ' {\n' >> "$KEEPALIVED_CONF"
}
config_section_close() {
+ local indent="$1"
+ [ -n "$indent" ] && printf '%b' "$indent" >> "$KEEPALIVED_CONF"
printf '}\n\n' >> "$KEEPALIVED_CONF"
}