From eb12a52083de95e61958726e4fb49cd621d9acce Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 25 May 2024 22:21:41 -0700 Subject: [PATCH] allow configuration of a site title for graphs1090 Especially when looking at the data for several sites it's nice to be able to tell which site you are looking at. Signed-off-by: Dirk Hohndel --- rootfs/etc/s6-overlay/startup.d/08-graphs1090-init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init b/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init index e0f5fdc..9573516 100755 --- a/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init +++ b/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init @@ -78,6 +78,12 @@ else sed -i 's|colorscheme=dark|colorscheme=default|g' /etc/default/graphs1090 fi +# use site name if provided: +if [[ -n "${GRAPHS1090_SITENAME}" ]]; then + sed -i "s/graphs1090: Performance Graphs<\/title>/<title>$GRAPHS1090_SITENAME: Performance Graphs<\/title>/" /usr/share/graphs1090/html/index.html + sed -i "s/<h1>Performance Graphs<\/h1>/<h1>Performance Graphs ($GRAPHS1090_SITENAME)<\/h1>/" /usr/share/graphs1090/html/index.html +fi + # Set Interval in seconds to feed data into RRD files. if [[ -n "${GRAPHS1090_RRD_STEP}" ]]; then sed -i "s|DRAW_INTERVAL=.*|DRAW_INTERVAL=${GRAPHS1090_RRD_STEP}|g" /etc/default/graphs1090