Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Commit 12c994d

Browse files
CopilotStolas
andcommitted
Add error handling for template file copy operations
Co-authored-by: Stolas <610753+Stolas@users.noreply.github.com>
1 parent a0f9550 commit 12c994d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

startup.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ NGINX_EOF
276276
# Copy template and update the HTML file with the services list
277277
local html_template="./nginx/index.html.template"
278278
local html_file="./nginx/index.html"
279+
if [ ! -f "${html_template}" ]; then
280+
echo "ERROR: HTML template file not found at ${html_template}"
281+
return 1
282+
fi
279283
cp "${html_template}" "${html_file}"
280284
sed -i "s|SERVICES_LIST|${services_html}|g" "${html_file}"
281285

@@ -521,6 +525,10 @@ NGINX_EOF
521525
# Copy template and update the HTML file with the services list
522526
local html_template="./nginx/index.html.template"
523527
local html_file="./nginx/index.html"
528+
if [ ! -f "${html_template}" ]; then
529+
echo "ERROR: HTML template file not found at ${html_template}"
530+
return 1
531+
fi
524532
cp "${html_template}" "${html_file}"
525533
sed -i "s|SERVICES_LIST|${services_html}|g" "${html_file}"
526534

0 commit comments

Comments
 (0)