From 1f1175135c8b15322852319150c8ed12d99b7a92 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 1 Oct 2018 16:14:20 +0200 Subject: T867: add support for running post-upgrade scripts. --- etc/init.d/vyatta-router | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'etc') diff --git a/etc/init.d/vyatta-router b/etc/init.d/vyatta-router index 530fe5c..c57387c 100755 --- a/etc/init.d/vyatta-router +++ b/etc/init.d/vyatta-router @@ -116,6 +116,21 @@ run_preconfig_script () fi } +run_postupgrade_script () +{ + if [ -f /config/.upgraded ]; then + # Run the system script + /usr/libexec/vyos/system/post-upgrade + + # Run user scripts + if [ -d /config/scripts/post-upgrade.d ]; then + run-parts /config/scripts/post-upgrade.d + fi + + rm -f /config/.upgraded + fi +} + # # On image booted machines, we need to mount /boot from the image-specific # boot directory so that kernel package installation will put the @@ -181,6 +196,8 @@ start () run_preconfig_script + run_postupgrade_script + for s in ${subinit[@]} ; do if ! disabled $s; then log_progress_msg $s -- cgit v1.2.3