packages/net/keepalived/files/etc/uci-defaults/keepalived
Florian Eckert 9b24763b9f keepalived: add upgrade script for globals section
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-05-04 09:07:00 +02:00

12 lines
328 B
Bash

#!/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