From cf3bd9cde9d739257218c20b4163bdbb20189b2a Mon Sep 17 00:00:00 2001 From: marc1uk Date: Tue, 2 Jul 2024 23:00:34 +0100 Subject: [PATCH] Create MonitoringSetup.sh Add MonitoringSetup.sh script to perform steps for modifying the main ToolAnalysis container for use with online monitoring. Should be run after the first `docker run` to create the monitoring container. --- MonitoringSetup.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 MonitoringSetup.sh diff --git a/MonitoringSetup.sh b/MonitoringSetup.sh new file mode 100644 index 000000000..d62162687 --- /dev/null +++ b/MonitoringSetup.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# this file is a shim to perform additional steps that configure the main ToolAnalysis container +# for use with the online Monitoring toolchain. This involves checking out the Monitoring branch, +# configuring the timezone, copying in a slack webhook, and re-building the Analyse executable. + +cd /ToolAnalysis; +echo "fetching ToolAnalysis marc1uk fork"; +git remote add marc1uk https://github.com/marc1uk/ToolAnalysis.git; +git fetch marc1uk; +echo "checking out monitoring branch"; +git checkout --track marc1uk/monitoring_detached; +echo "setting up environment"; +. Setup.sh; +echo "building"; +make clean; +make -j2; +echo "building again to be sure"; +make -j2; +echo "configuring timezone to Chicago time"; +if [ -f /etc/localtime ]; then + rm -f /etc/localtime; +fi +if [ -f /usr/share/zoneinfo/America/Chicago ]; then + ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime; +else + echo "Chicago timezone not found!" + export TZ=America/Chicago +fi +if [ -f configfiles/Monitoring/slack_webhook ] && [ -f /tmp/slack_webhook ]; then + echo "removing old slack webhook" + rm config/Monitoring/slack_webhook; +fi; +if [ -f /tmp/slack_webhook ]; then + echo "binding in new slack webhook" + ln -s /tmp/slack_webhook configfiles/Monitoring/slack_webhook; +else + echo "new slack webhook not found!" +fi +echo "ToolAnalysis ready: source Setup.sh and run './Analyse Monitoring&'"