summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/init/vyos-router24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/init/vyos-router b/src/init/vyos-router
index 7b752b84b..96f163213 100755
--- a/src/init/vyos-router
+++ b/src/init/vyos-router
@@ -101,6 +101,16 @@ load_bootfile ()
)
}
+# restore if missing pre-config script
+restore_if_missing_preconfig_script ()
+{
+ if [ ! -x ${vyatta_sysconfdir}/config/scripts/vyos-preconfig-bootup.script ]; then
+ cp ${vyos_rootfs_dir}/opt/vyatta/etc/config/scripts/vyos-preconfig-bootup.script ${vyatta_sysconfdir}/config/scripts/
+ chgrp ${GROUP} ${vyatta_sysconfdir}/config/scripts/vyos-preconfig-bootup.script
+ chmod 750 ${vyatta_sysconfdir}/config/scripts/vyos-preconfig-bootup.script
+ fi
+}
+
# execute the pre-config script
run_preconfig_script ()
{
@@ -109,6 +119,16 @@ run_preconfig_script ()
fi
}
+# restore if missing post-config script
+restore_if_missing_postconfig_script ()
+{
+ if [ ! -x ${vyatta_sysconfdir}/config/scripts/vyos-postconfig-bootup.script ]; then
+ cp ${vyos_rootfs_dir}/opt/vyatta/etc/config/scripts/vyos-postconfig-bootup.script ${vyatta_sysconfdir}/config/scripts/
+ chgrp ${GROUP} ${vyatta_sysconfdir}/config/scripts/vyos-postconfig-bootup.script
+ chmod 750 ${vyatta_sysconfdir}/config/scripts/vyos-postconfig-bootup.script
+ fi
+}
+
# execute the post-config scripts
run_postconfig_scripts ()
{
@@ -360,6 +380,8 @@ start ()
log_daemon_msg "Starting VyOS router"
disabled migrate || migrate_bootfile
+ restore_if_missing_preconfig_script
+
run_preconfig_script
run_postupgrade_script
@@ -384,6 +406,8 @@ start ()
telinit q
chmod g-w,o-w /
+ restore_if_missing_postconfig_script
+
run_postconfig_scripts
}