net/keepalived: move track_interface generation into own section
In a vrrp_instance the track_interface could not be referenced similar to a track_script. The uci track_interface section must be always set into every vrrp_instance. During config generation use the already prepared function "print_track_elem_indent" to write the track_interface section into every vrrp_instance which references this. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
b66372fb43
commit
d4e1c96cc4
1 changed files with 14 additions and 2 deletions
|
@ -297,8 +297,8 @@ vrrp_instance() {
|
||||||
printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
|
printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
|
||||||
done
|
done
|
||||||
|
|
||||||
# Handle track_interface & track_script lists
|
# Handle track_script lists
|
||||||
for opt in track_interface track_script; do
|
for opt in track_script; do
|
||||||
config_get $opt $1 $opt
|
config_get $opt $1 $opt
|
||||||
eval optval=\$$opt
|
eval optval=\$$opt
|
||||||
[ -z "$optval" ] && continue
|
[ -z "$optval" ] && continue
|
||||||
|
@ -309,6 +309,18 @@ vrrp_instance() {
|
||||||
printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
|
printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Handle track_interface lists
|
||||||
|
for opt in track_interface; do
|
||||||
|
config_get $opt $1 $opt
|
||||||
|
eval optval=\$$opt
|
||||||
|
[ -z "$optval" ] && continue
|
||||||
|
printf "$INDENT_1$opt {\n" >> $KEEPALIVED_CONF
|
||||||
|
for t in $optval; do
|
||||||
|
config_foreach print_track_elem_indent track_interface $t $INDENT_2
|
||||||
|
done
|
||||||
|
printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
|
||||||
|
done
|
||||||
|
|
||||||
# Handle simple lists of strings (with no spaces in between)
|
# Handle simple lists of strings (with no spaces in between)
|
||||||
for opt in unicast_peer; do
|
for opt in unicast_peer; do
|
||||||
config_get $opt $1 $opt
|
config_get $opt $1 $opt
|
||||||
|
|
Loading…
Reference in a new issue