Merge pull request #5334 from bill-mahoney/fix/atomic-ipv6-config-write

Fix silent nginx config corruption in 50-ipv6.sh
This commit is contained in:
jc21
2026-02-25 08:35:11 +10:00
committed by GitHub

View File

@@ -25,7 +25,13 @@ process_folder () {
for FILE in $FILES
do
echo "- ${FILE}"
echo "$(sed -E "$SED_REGEX" "$FILE")" > $FILE
TMPFILE="${FILE}.tmp"
if sed -E "$SED_REGEX" "$FILE" > "$TMPFILE" && [ -s "$TMPFILE" ]; then
mv "$TMPFILE" "$FILE"
else
echo "WARNING: skipping ${FILE} — sed produced empty output" >&2
rm -f "$TMPFILE"
fi
done
# ensure the files are still owned by the npm user