Browse Source

net/keepalived: add quoting for print_elems_indent function

If you add a notify_* script which is not only a path to a script or
to a bin file, it is necessary to quote to whole string. If you do not
quote this the config will not get accepted by keepalived and so will
not start. This will fix this issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
lilik-openwrt-22.03
Florian Eckert 7 years ago
parent
commit
b66372fb43
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      net/keepalived/files/keepalived.init

+ 8
- 1
net/keepalived/files/keepalived.init View File

@ -49,7 +49,14 @@ print_elems_indent() {
eval optval=\$$opt eval optval=\$$opt
[ -z "$optval" ] && continue [ -z "$optval" ] && continue
printf "$indent$opt" >> $KEEPALIVED_CONF printf "$indent$opt" >> $KEEPALIVED_CONF
[ "$no_val" == "0" ] && printf " $optval" >> $KEEPALIVED_CONF
[ "$no_val" == "0" ] && {
local words=$(echo "$optval" | wc -w)
if [ $words -gt 1 ]; then
printf " \"$optval\"" >> $KEEPALIVED_CONF
else
printf " $optval" >> $KEEPALIVED_CONF
fi
}
printf "\n" >> $KEEPALIVED_CONF printf "\n" >> $KEEPALIVED_CONF
done done
unset optval unset optval


Loading…
Cancel
Save