From 09edb0a8e69dc302d3d7372f40ab07c9cc2157a5 Mon Sep 17 00:00:00 2001 From: glenneth Date: Fri, 2 Jan 2026 13:55:46 +0300 Subject: [PATCH] fix: Use head/cat instead of sed for multi-line YP snippet insertion --- docker/icecast-entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/icecast-entrypoint.sh b/docker/icecast-entrypoint.sh index 7099c2a..b001030 100644 --- a/docker/icecast-entrypoint.sh +++ b/docker/icecast-entrypoint.sh @@ -14,7 +14,11 @@ sed -i "s|localhost|$ICECAST_HOSTNAME| if [ "$ICECAST_ENABLE_YP" = "true" ]; then echo "YP directory publishing ENABLED" # Insert YP config before closing tag - sed -i 's||'"$(cat /etc/icecast-yp-snippet.xml)"'\n|' /etc/icecast.xml + # Use sed with a temp file to handle multi-line insertion + head -n -1 /etc/icecast.xml > /tmp/icecast-temp.xml + cat /etc/icecast-yp-snippet.xml >> /tmp/icecast-temp.xml + echo "" >> /tmp/icecast-temp.xml + mv /tmp/icecast-temp.xml /etc/icecast.xml else echo "YP directory publishing DISABLED (dev mode)" fi