Browse Source

keepalived: add upgrade script for globals section

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
lilik-openwrt-22.03
Florian Eckert 5 years ago
committed by Florian Eckert
parent
commit
9b24763b9f
2 changed files with 16 additions and 0 deletions
  1. +4
    -0
      net/keepalived/Makefile
  2. +12
    -0
      net/keepalived/files/etc/uci-defaults/keepalived

+ 4
- 0
net/keepalived/Makefile View File

@ -216,6 +216,10 @@ define Package/keepalived/install
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/keepalived/keepalived.conf \ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/keepalived/keepalived.conf \
$(1)/etc/keepalived/ $(1)/etc/keepalived/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/keepalived \
$(1)/etc/uci-defaults/keepalived
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/keepalived.init \ $(INSTALL_BIN) ./files/keepalived.init \
$(1)/etc/init.d/keepalived $(1)/etc/init.d/keepalived


+ 12
- 0
net/keepalived/files/etc/uci-defaults/keepalived View File

@ -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

Loading…
Cancel
Save