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 <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-10-17 16:32:41 +02:00
parent c6fae88268
commit 52023e918a
+2 -2
View File
@@ -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