We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f236a0d commit 48bb2b2Copy full SHA for 48bb2b2
plugin/source/dynamix.unraid.net/install/scripts/file_patches.sh
@@ -18,8 +18,9 @@ if ! grep -q "#robots.txt any origin" "${FILE}" >/dev/null 2>&1; then
18
cp "$FILE" "$FILE-"
19
FIND="location = \/robots.txt {"
20
# escape tabs and spaces
21
- ADD="\ \ \ \ \ add_header Access-Control-Allow-Origin *; #robots.txt any origin"
22
- sed -i "/${FIND}/a ${ADD}" "${FILE}"
+ ADD="\t add_header Access-Control-Allow-Origin *; #robots.txt any origin"
+ # shell-safe: pass ADD via printf to preserve escapes
23
+ sed -i "/${FIND}/a $(printf '%s\n' "${ADD}")" "${FILE}"
24
NGINX_CHANGED=1
25
fi
26
0 commit comments