Skip to content

Commit

Permalink
confd: regenerate factory-config if factory-config.gen is missing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
troglobit committed Oct 17, 2023
1 parent c6fae88 commit 52023e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/confd/bin/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 52023e9

Please sign in to comment.