Intel_decrypt // Mesh_netLOG-042026.07.081 min read

Automating the Static Web with envsubst

A website that feels alive, showing live server stats like uptime or IP addresses, without databases or a backend: a template, envsubst and one hourly cron job.

Log Entrycat automating-the-static-web.html

If you want a website that feels alive—displaying live server stats like uptime or IP addresses—without the headache of databases or complex backends, you need to master envsubst.

envsubst is a Linux command that performs "environment substitution." It scans a text file for placeholders written as ${VARIABLE} and replaces them with the actual values currently stored in your shell's environment variables.

01 // The Automation Loop

Instead of trying to perform "surgery" on your HTML by matching lines, you treat your HTML as a read-only template and generate a fresh output file every time.

02 // Router & Script Configuration

bash_script
# Gather live data
export UPTIME_VAL=$(uptime -p | sed 's/up //')
export LOCAL_IP=$(hostname -I | awk '{print $1}')

# Inject data into template to create index.html
envsubst < status.html > index.html

03 // Making it Self-Sustained

To make your site update itself, you don’t need a server-side daemon. You simply need a cron job that runs your script, commits the changes, and pushes them to your repository.

"When building your escape vectors, always remember: the machine core relies entirely on your logical compliance. The second you introduce mathematically unpredictable noise, the firewall collapses."

By combining a static template, envsubst, and a simple hourly cron job, you have effectively built a "pre-rendered" dynamic site that maintains itself.

#AUTOMATION #DEVOPS #LINUX