From a6ac1f2af12107eda02197a0aae70b4347c06c57 Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Mon, 31 Aug 2026 14:26:21 -0700 Subject: [PATCH] et-mercury-stats - Initial tool to help analyze Mercury HF logs --- REGRESSION.md | 10 ++++-- scripts/install-mercury-stats.sh | 62 ++++++++++++++++++++++++++++++++ scripts/install.sh | 3 +- tests/test-mercury-stats | 7 ++++ 4 files changed, 78 insertions(+), 4 deletions(-) create mode 100755 scripts/install-mercury-stats.sh create mode 100755 tests/test-mercury-stats diff --git a/REGRESSION.md b/REGRESSION.md index a11078d..06d83c0 100644 --- a/REGRESSION.md +++ b/REGRESSION.md @@ -1,7 +1,7 @@ # EmComm Tools Regression Tests -- **Build**: ETC R7 Build 18 -- **Date**: 23 August 2026 +- **Build**: ETC R7 Build 19 +- **Date**: 31 August 2026 ## First Login @@ -118,6 +118,11 @@ * [ ] et-mode VARA FM (Winlink) * [ ] et-mode VARA HF (Winlink) +## Mercury HF + +* [ ] et-mode Mercury HF (Winlink) +* [ ] et-mercury-stats + ## Security * [ ] gpa @@ -170,7 +175,6 @@ ## Modems * [ ] modem73 -* [ ] mercury ## Email/Internet diff --git a/scripts/install-mercury-stats.sh b/scripts/install-mercury-stats.sh new file mode 100755 index 0000000..252bd03 --- /dev/null +++ b/scripts/install-mercury-stats.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 31 August 2026 +# Purpose : Install Mercury Stats +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +. ./env.sh + +APP=mercury-stats +VERSION=0.1.0 +APP_AND_VERSION="${APP}-${VERSION}" +DOWNLOAD_FILE="${APP}-${VERSION}.tar.gz" +URL="https://github.com/thetechprepper/mercury-stats/archive/refs/tags/${VERSION}.tar.gz" +SRC_DIR="${ET_SRC_DIR}/${APP}-${VERSION}" +INSTALL_DIR="/opt/${APP}-${VERSION}" +INSTALL_BIN_DIR="${INSTALL_DIR}/bin" +INSTALL_LIB_DIR="${INSTALL_DIR}/lib/${APP}" +LINK_PATH="/opt/${APP}" + +et-log "Installing ${APP} ${VERSION}..." + +if [[ ! -e "${ET_DIST_DIR}/${DOWNLOAD_FILE}" ]]; then + + et-log "Downloading ${APP}: ${URL}" + curl -s -L -o ${DOWNLOAD_FILE} --fail ${URL} + + mv ${DOWNLOAD_FILE} ${ET_DIST_DIR} +fi + +CWD_DIR=`pwd` + +et-log "Unpacking ${APP} ${VERSION} source..." +tar -xzf "${ET_DIST_DIR}/${DOWNLOAD_FILE}" + +[ -e ${SRC_DIR} ] && rm -rf "${SRC_DIR}" +mv "${APP_AND_VERSION}" ${ET_SRC_DIR} && cd ${SRC_DIR} + +mkdir -v -p ${INSTALL_LIB_DIR} +cp -v *.py ${INSTALL_LIB_DIR} + +mkdir -v -p ${INSTALL_BIN_DIR} + +cat <<'EOF' > "${INSTALL_BIN_DIR}/et-mercury-stats" +#!/bin/bash + +APP_ROOT="/opt/mercury-stats" + +exec /usr/bin/python3 \ + "${APP_ROOT}/lib/mercury-stats/mercury_stats.py" \ + "$@" +EOF + +chmod 755 "${INSTALL_BIN_DIR}/et-mercury-stats" + +[[ -e ${LINK_PATH} ]] && rm ${LINK_PATH} +ln -v -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt ${APP} -t /usr/local + +cd $CWD_DIR diff --git a/scripts/install.sh b/scripts/install.sh index a2ce0f4..0b9ed89 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 9 August 2026 +# Updated : 31 August 2026 # Purpose : Main installer for EmComm Tools Community (ETC) . ./env.sh @@ -123,6 +123,7 @@ exitIfNotRoot ./install-meshchat.sh ./install-modem73.sh ./install-mercury.sh +./install-mercury-stats.sh ./install-offline-rnode-firmware.sh # Debrand Ubuntu diff --git a/tests/test-mercury-stats b/tests/test-mercury-stats new file mode 100755 index 0000000..131eba5 --- /dev/null +++ b/tests/test-mercury-stats @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 31 August 2026 +# Purpose : Test et-mercury-stats installation + +OUT=$(which et-mercury-stats) +exit $?