diff options
author | John Estabrook <jestabro@vyos.io> | 2024-10-24 10:50:34 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2024-12-10 14:01:22 -0600 |
commit | 0c4d653fc2db57df294856c2c77fe89d6f5923b8 (patch) | |
tree | cf72d6157f6106bb64b2e71bba3ecc55939c612d /src | |
parent | 466c6ad3762faf46149c651a244b47fb4b2efea2 (diff) | |
download | vyos-1x-0c4d653fc2db57df294856c2c77fe89d6f5923b8.tar.gz vyos-1x-0c4d653fc2db57df294856c2c77fe89d6f5923b8.zip |
vyconf: T6718: add boot configs
Add current config and failsafe for vyconfd to load on startup.
Diffstat (limited to 'src')
-rwxr-xr-x | src/init/vyos-router | 10 |
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 } |