From 52023e918a75aa3ad0432fd9f932fe21f979ef43 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 16 Oct 2023 15:38:07 +0200 Subject: [PATCH] confd: regenerate factory-config if factory-config.gen is missing Regenerate if either factory-config.gen or failure-config.gen is missing. This should not happen, but is better to check for the result rather than the intermediate result. Signed-off-by: Joachim Wiberg --- src/confd/bin/bootstrap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/confd/bin/bootstrap b/src/confd/bin/bootstrap index 41bacd9a..f26f1aa9 100755 --- a/src/confd/bin/bootstrap +++ b/src/confd/bin/bootstrap @@ -31,7 +31,7 @@ FACTORY_GEN="$(dirname "$FACTORY_CFG")/$(basename "$FACTORY_CFG" .cfg).gen" FAILURE_GEN="$(dirname "$FAILURE_CFG")/$(basename "$FAILURE_CFG" .cfg).gen" # Generate device's factory-config at first boot or on override -if [ ! -d "$FACTORY_D" ] || [ "$FACTORY_OVERRIDE" = "true" ]; then +if [ ! -f "$FACTORY_GEN" ] || [ "$FACTORY_OVERRIDE" = "true" ]; then mkdir -p "$FACTORY_D" # Save the original templates (from the original image) used to create factory-config @@ -65,7 +65,7 @@ if [ ! -d "$FACTORY_D" ] || [ "$FACTORY_OVERRIDE" = "true" ]; then fi # Generate device's failure-config at first boot -if [ ! -d "$FAILURE_D" ] || [ "$FAILURE_OVERRIDE" = "true" ]; then +if [ ! -f "$FAILURE_GEN" ] || [ "$FAILURE_OVERRIDE" = "true" ]; then mkdir -p "$FAILURE_D" # Save the original templates (from the original image) used to create failure-config