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 <redacted>
eval optval=\$$opt
[ -z "$optval" ] && continue
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
done
unset optval