Skip to content

Commit 52023e9

Browse files
committed
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>
1 parent c6fae88 commit 52023e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/confd/bin/bootstrap

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ FACTORY_GEN="$(dirname "$FACTORY_CFG")/$(basename "$FACTORY_CFG" .cfg).gen"
3131
FAILURE_GEN="$(dirname "$FAILURE_CFG")/$(basename "$FAILURE_CFG" .cfg).gen"
3232

3333
# Generate device's factory-config at first boot or on override
34-
if [ ! -d "$FACTORY_D" ] || [ "$FACTORY_OVERRIDE" = "true" ]; then
34+
if [ ! -f "$FACTORY_GEN" ] || [ "$FACTORY_OVERRIDE" = "true" ]; then
3535
mkdir -p "$FACTORY_D"
3636

3737
# 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
6565
fi
6666

6767
# Generate device's failure-config at first boot
68-
if [ ! -d "$FAILURE_D" ] || [ "$FAILURE_OVERRIDE" = "true" ]; then
68+
if [ ! -f "$FAILURE_GEN" ] || [ "$FAILURE_OVERRIDE" = "true" ]; then
6969
mkdir -p "$FAILURE_D"
7070

7171
# Save the original templates (from the original image) used to create failure-config

0 commit comments

Comments
 (0)