#!/bin/sh
# The sync key moved from the keepalived user's home, which sysupgrade
# doesn't keep, to /etc/keepalived/keys. Copy an existing key there before
# the next upgrade loses it, so the backups keep trusting it, and point the
# generated send peers at it.

[ -f /usr/share/keepalived-ha/setup.sh ] || exit 0
. /usr/share/keepalived-ha/setup.sh

kaha_migrate_key
kaha_set_peer_keys
kaha_uci -q commit keepalived

exit 0
