keepalived: add upgrade script for globals section

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert
2020-04-30 08:39:59 +02:00
committed by Florian Eckert
parent fd7e741474
commit 9b24763b9f
2 changed files with 16 additions and 0 deletions
@@ -0,0 +1,12 @@
#!/bin/sh
# Check if old config section is still in use
uci show keepalived.@global_defs[-1] 1>/dev/null 2>/dev/null
if [ "$?" -eq "0" ]; then
uci -q rename keepalived.@global_defs[-1]=globals
uci -q commit keepalived
sed -i "s|^config global_defs 'globals'$|config globals 'globals'|" \
/etc/config/keepalived
fi
exit 0