Skip to content

Commit 48bb2b2

Browse files
committed
fix: patches escaping
1 parent f236a0d commit 48bb2b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugin/source/dynamix.unraid.net/install/scripts/file_patches.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ if ! grep -q "#robots.txt any origin" "${FILE}" >/dev/null 2>&1; then
1818
cp "$FILE" "$FILE-"
1919
FIND="location = \/robots.txt {"
2020
# escape tabs and spaces
21-
ADD="\ \ \ \ \ add_header Access-Control-Allow-Origin *; #robots.txt any origin"
22-
sed -i "/${FIND}/a ${ADD}" "${FILE}"
21+
ADD="\t add_header Access-Control-Allow-Origin *; #robots.txt any origin"
22+
# shell-safe: pass ADD via printf to preserve escapes
23+
sed -i "/${FIND}/a $(printf '%s\n' "${ADD}")" "${FILE}"
2324
NGINX_CHANGED=1
2425
fi
2526

0 commit comments

Comments
 (0)