summaryrefslogtreecommitdiff
path: root/etc/init.d
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-10-01 16:14:20 +0200
committerDaniil Baturin <daniil@baturin.org>2018-10-01 16:14:20 +0200
commit1f1175135c8b15322852319150c8ed12d99b7a92 (patch)
treea11da4b3a8245517bd05bc0e6a2b5e232a47aa0c /etc/init.d
parenta14c7c1af0c7f4de51db922aba1d61addfe5747f (diff)
downloadvyatta-cfg-1f1175135c8b15322852319150c8ed12d99b7a92.tar.gz
vyatta-cfg-1f1175135c8b15322852319150c8ed12d99b7a92.zip
T867: add support for running post-upgrade scripts.
Diffstat (limited to 'etc/init.d')
-rwxr-xr-xetc/init.d/vyatta-router17
1 files changed, 17 insertions, 0 deletions
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