I have a homepage ./index.html, and on this page I would like to display a variable that was created in my ./cgi-bin/print_ip.sh file.
What is the cleanest way of accomplishing this?
if you can use shtml, take a look at here https://www.computerhope.com/jargon/s/shtml.htm
shtml is like html where you can dynamicly include some stuff from the webserver:
<!--#exec cmd="cgi-bin/mycounter.cgi" -->
<!--#include virtual="/cgi-bin/mycounter.cgi" -->
<insert file="cgi-bin/mycounter.cgi">
<!--#echo var="DATE_LOCAL" -->
index.htmlgenerated dynamically. The easier way is to have a smalliframe. If it should remain static and you want it well integrated into the page, use a bit of JS to request the value and insert it into the page.ip=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)