From 9b24763b9f8958c53e47c02dbc8e4b007a30f0fc Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 30 Apr 2020 08:39:59 +0200 Subject: [PATCH] keepalived: add upgrade script for globals section Signed-off-by: Florian Eckert --- net/keepalived/Makefile | 4 ++++ net/keepalived/files/etc/uci-defaults/keepalived | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 net/keepalived/files/etc/uci-defaults/keepalived diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile index 6ac3436147..f8ca3da915 100644 --- a/net/keepalived/Makefile +++ b/net/keepalived/Makefile @@ -216,6 +216,10 @@ define Package/keepalived/install $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/keepalived/keepalived.conf \ $(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_BIN) ./files/keepalived.init \ $(1)/etc/init.d/keepalived diff --git a/net/keepalived/files/etc/uci-defaults/keepalived b/net/keepalived/files/etc/uci-defaults/keepalived new file mode 100644 index 0000000000..ff5ff7d7d4 --- /dev/null +++ b/net/keepalived/files/etc/uci-defaults/keepalived @@ -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 -- 2.30.2