From bfa55902fddc993ea68c005a0db37e7cc0b87c8c Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 22 Nov 2024 06:52:11 -0700 Subject: [PATCH] BBS - Install BBS client. This is a work-in-progress (WiP), so the zero-configuration support and addition to et-mode (mode switcher) will come in a later release. --- overlay/etc/skel/.config/paracon/paracon.cfg | 4 ++ scripts/install-bbs-client.sh | 43 ++++++++++++++++++++ scripts/install.sh | 3 +- tests/test-paracon | 7 ++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 overlay/etc/skel/.config/paracon/paracon.cfg create mode 100755 scripts/install-bbs-client.sh create mode 100755 tests/test-paracon diff --git a/overlay/etc/skel/.config/paracon/paracon.cfg b/overlay/etc/skel/.config/paracon/paracon.cfg new file mode 100644 index 0000000..b742b32 --- /dev/null +++ b/overlay/etc/skel/.config/paracon/paracon.cfg @@ -0,0 +1,4 @@ +[Setup] +host = localhost +callsign = N0CALL + diff --git a/scripts/install-bbs-client.sh b/scripts/install-bbs-client.sh new file mode 100755 index 0000000..94db77a --- /dev/null +++ b/scripts/install-bbs-client.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 20 November 2024 +# Purpose : Install BBS client (Paracon) +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +VERSION=1.1.0 +DOWNLOAD_FILE=paracon_${VERSION}.pyz + +BIN_FILE=paracon +INSTALL_DIR=/opt/paracon-${VERSION} +INSTALL_BIN_DIR="${INSTALL_DIR}/bin" +LINK_PATH=/opt/paracon + +et-log "Installing BBS client dependencies..." +apt install \ + python3 \ + -y + +et-log "Installing BBS client..." + +if [ ! -e ${INSTALL_BIN_DIR} ]; then + et-log "Creating Paracon install directory: ${INSTALL_BIN_DIR}" + mkdir -v -p ${INSTALL_BIN_DIR} +fi + +if [ ! -e ${INSTALL_BIN_DIR}/${BIN_FILE} ]; then + URL="https://github.com/mfncooper/paracon/releases/download/v${VERSION}/${DOWNLOAD_FILE}" + + et-log "Downloading Paracon: ${URL}" + curl -s -L -o ${BIN_FILE} --fail ${URL} + + mv -v ${BIN_FILE} ${INSTALL_BIN_DIR} +fi + +chmod 755 ${INSTALL_BIN_DIR}/${BIN_FILE} + +[ -e ${LINK_PATH} ] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt paracon -t /usr/local diff --git a/scripts/install.sh b/scripts/install.sh index 2812229..192fa06 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 5 November 2024 +# Updated : 22 November 2024 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -38,6 +38,7 @@ exitIfNotRoot # Install packet tool chain ./install-direwolf.sh ./install-yaac.sh +./install-bbs-client.sh # Install modems ./install-ardop.sh diff --git a/tests/test-paracon b/tests/test-paracon new file mode 100755 index 0000000..aefc886 --- /dev/null +++ b/tests/test-paracon @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 21 November 2024 +# Purpose : Test paracon installation + +OUT=$(which paracon) +exit $?