mirror of
https://github.com/openwrt/packages.git
synced 2026-02-04 12:06:29 +08:00
keepalived: only add content to config file if needed
Only add the first two pieces of information to the configuration file if there is a valid '/etc/config/keepalived'. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
committed by
Florian Eckert
parent
9db0eab9c5
commit
1d79439834
@@ -600,11 +600,6 @@ process_config() {
|
||||
local alt_config_file linkbeat_use_polling
|
||||
|
||||
rm -f "$KEEPALIVED_CONF"
|
||||
|
||||
# First line
|
||||
printf '! Configuration file for keepalived (autogenerated via init script)\n' > "$KEEPALIVED_CONF"
|
||||
printf '! Written %s\n\n' "$(date +'%c')" >> "$KEEPALIVED_CONF"
|
||||
|
||||
[ -f /etc/config/keepalived ] || return 0
|
||||
config_load 'keepalived'
|
||||
config_get alt_config_file globals alt_config_file
|
||||
@@ -617,6 +612,10 @@ process_config() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# First line
|
||||
printf '! Configuration file for keepalived (autogenerated via init script)\n' > "$KEEPALIVED_CONF"
|
||||
printf '! Written %s\n\n' "$(date +'%c')" >> "$KEEPALIVED_CONF"
|
||||
|
||||
config_get_bool linkbeat_use_polling globals linkbeat_use_polling 0
|
||||
[ "$linkbeat_use_polling" -gt 0 ] && printf 'linkbeat_use_polling\n\n' >> "$KEEPALIVED_CONF"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user