mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 13:03:02 +02:00
confd: load test-config when in test-mode
This commit is contained in:
committed by
Mattias Walström
parent
4a325af4e4
commit
837fb0ee7f
+12
-1
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# load [-b] <startup-config | failure-config>
|
||||
# load [-b] <startup-config | failure-config | test-config>
|
||||
#
|
||||
# Import a configuration to the sysrepo datastore using `sysrepocfg -Ifile`
|
||||
#
|
||||
@@ -41,6 +41,17 @@ err()
|
||||
. /etc/confdrc
|
||||
|
||||
config=$1
|
||||
|
||||
if [ -f "/mnt/aux/test-mode" ] && [ "$config" = "startup-config" ]; then
|
||||
|
||||
if [ -f "/mnt/aux/test-override-startup" ]; then
|
||||
rm -f "/mnt/aux/test-override-startup"
|
||||
else
|
||||
note "Test mode detected, switching to test-config"
|
||||
config="test-config"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$config" ]; then
|
||||
fn="$config"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user