From 2284fcabbd24b178246afd8d946141e076813f0f Mon Sep 17 00:00:00 2001 From: Sukru Senli Date: Fri, 9 Oct 2020 21:52:33 +0200 Subject: [PATCH] icwmp: keep cwmp session backup xml file over upgrade --- .../lib/upgrade/post-rootfs-fixup.d/215-icwmp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 icwmp/files/lib/upgrade/post-rootfs-fixup.d/215-icwmp diff --git a/icwmp/files/lib/upgrade/post-rootfs-fixup.d/215-icwmp b/icwmp/files/lib/upgrade/post-rootfs-fixup.d/215-icwmp new file mode 100755 index 000000000..1bf3f4511 --- /dev/null +++ b/icwmp/files/lib/upgrade/post-rootfs-fixup.d/215-icwmp @@ -0,0 +1,29 @@ +#!/bin/sh + +# As part of sysupgrade we copy CWMP Backup Session XML file. + + +# Abort on any error. +set -e + + +# Do nothing if user want to discard old settings. +if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then + exit 0 +fi + +# Source functions. +for f in /lib/upgrade/iopsys*.sh; do + [ -r "$f" -a -s "$f" ] || continue + source $f +done + + +if [ -s "${2}/etc/icwmpd/.icwmpd_backup_session.xml" ]; then + cat "${2}/etc/icwmpd/.icwmpd_backup_session.xml" > "/etc/icwmpd/.icwmpd_backup_session.xml" +fi + +# Report success. +log "post-hooks" "CWMP Backup Session XML file migrated" + +exit 0