mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 12:06:36 +02:00
remove old jinja template rendering
This commit is contained in:
@@ -508,57 +508,4 @@ else
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if running as user "pi":
|
# EOF
|
||||||
# - write results to a JSON file on RAM disk
|
|
||||||
# - update info.html file
|
|
||||||
if [ "${EUID}" = "$(id -u pi)" ]; then
|
|
||||||
|
|
||||||
json_ln_baseInfo=$(echo "${ln_baseInfo}" | cut -c 11-)
|
|
||||||
|
|
||||||
cat <<EOF > /var/cache/raspiblitz/info.json
|
|
||||||
{
|
|
||||||
"uptime": "${uptime}",
|
|
||||||
"datetime": "${datetime}",
|
|
||||||
"codeVersion": "${codeVersion}",
|
|
||||||
"hostname": "${hostname}",
|
|
||||||
"network": "${network}",
|
|
||||||
"torInfo": "${torInfo}",
|
|
||||||
"load": "${load}",
|
|
||||||
"tempC": "${tempC}",
|
|
||||||
"tempF": "${tempF}",
|
|
||||||
"ram": "${ram}",
|
|
||||||
"hddUsedInfo": "${hddUsedInfo}",
|
|
||||||
"local_ip": "${local_ip}",
|
|
||||||
"network_rx": "${network_rx}",
|
|
||||||
"network_tx": "${network_tx}",
|
|
||||||
"runningRTL": "${runningRTL}",
|
|
||||||
"networkVersion": "${networkVersion}",
|
|
||||||
"chain": "${chain}",
|
|
||||||
"progress": "${progress}",
|
|
||||||
"sync_percentage": "${sync_percentage}",
|
|
||||||
"public_addr_pre": "${public_addr_pre}",
|
|
||||||
"public_addr": "${public_addr}",
|
|
||||||
"public": "${public}",
|
|
||||||
"networkConnections": "${networkConnections}",
|
|
||||||
"mempool": "${mempool}",
|
|
||||||
"ln_sync": "${ln_sync}",
|
|
||||||
"ln_version": "${ln_version}",
|
|
||||||
"ln_baseInfo": "${json_ln_baseInfo}",
|
|
||||||
"ln_peers": "${ln_peers}",
|
|
||||||
"ln_channelInfo": "${ln_channelInfo}",
|
|
||||||
"ln_external": "${ln_external}"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# use Jinja2 and apply json data to template to produce static html file
|
|
||||||
templateExists=$(sudo ls /var/cache/raspiblitz/info.json 2>/dev/null | grep -c 'info.json')
|
|
||||||
if [ ${templateExists} -gt 0 ]; then
|
|
||||||
res=$(/usr/local/bin/j2 /var/www/blitzweb/info/info.j2 /var/cache/raspiblitz/info.json -o /var/cache/raspiblitz/info.html)
|
|
||||||
if ! [ $? -eq 0 ]; then
|
|
||||||
echo "an error occured.. maybe JSON syntax is wrong..!"
|
|
||||||
echo "${res}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
# EOF
|
|
Reference in New Issue
Block a user