summaryrefslogtreecommitdiff
path: root/src/init/vyos-router
diff options
context:
space:
mode:
Diffstat (limited to 'src/init/vyos-router')
-rwxr-xr-xsrc/init/vyos-router10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/init/vyos-router b/src/init/vyos-router
index f8cc87507..9325095c1 100755
--- a/src/init/vyos-router
+++ b/src/init/vyos-router
@@ -24,6 +24,8 @@ declare action=$1; shift
declare -x BOOTFILE=$vyatta_sysconfdir/config/config.boot
declare -x DEFAULT_BOOTFILE=$vyatta_sysconfdir/config.boot.default
+declare -x VYCONF_CONFIG_DIR=/usr/libexec/vyos/vyconf/config
+
# If vyos-config= boot option is present, use that file instead
for x in $(cat /proc/cmdline); do
[[ $x = vyos-config=* ]] || continue
@@ -146,6 +148,10 @@ init_bootfile () {
chgrp ${GROUP} $BOOTFILE
chmod 660 $BOOTFILE
fi
+ if [ -d $VYCONF_CONFIG_DIR ] ; then
+ cp -f $BOOTFILE $VYCONF_CONFIG_DIR/config.boot
+ cp -f $DEFAULT_BOOTFILE $VYCONF_CONFIG_DIR/config.failsafe
+ fi
}
# if necessary, migrate initial config
@@ -154,6 +160,10 @@ migrate_bootfile ()
if [ -x $vyos_libexec_dir/run-config-migration.py ]; then
log_progress_msg migrate
sg ${GROUP} -c "$vyos_libexec_dir/run-config-migration.py $BOOTFILE"
+ # update vyconf copy after migration
+ if [ -d $VYCONF_CONFIG_DIR ] ; then
+ cp -f $BOOTFILE $VYCONF_CONFIG_DIR/config.boot
+ fi
fi
}