diff --git a/scripts/install-chattervox.sh b/scripts/install-chattervox.sh new file mode 100755 index 0000000..b73ec18 --- /dev/null +++ b/scripts/install-chattervox.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 4 December 2024 +# Purpose : Install chattervox protocol +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 + +NAME=chattervox +VERSION=0.7.0 +TARBALL=chattervox-linux-x64.tar.gz +INSTALL_DIR="/opt/${NAME}-${VERSION}" +LINK_PATH="/opt/${NAME}" + +et-log "Installing ${NAME} ${VERSION}..." + +URL=https://github.com/brannondorsey/chattervox/releases/download/v${VERSION}/chattervox-linux-x64.tar.gz + +et-log "Downloading: ${URL}" +curl -s -L -o ${TARBALL} --fail ${URL} + +CWD_DIR=`pwd` + +tar -xzf ${TARBALL} + +if [ -e chattervox-linux-x64 ]; then + mv chattervox-linux-x64 ${INSTALL_DIR} + mkdir -p ${INSTALL_DIR}/bin + mv ${INSTALL_DIR}/chattervox ${INSTALL_DIR}/bin/ + mv ${INSTALL_DIR}/serialport.node ${INSTALL_DIR}/bin/ + rm -v ${TARBALL} +fi + +[ -e ${LINK_PATH} ] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt ${NAME} -t /usr/local + +cd $CWD_DIR diff --git a/scripts/install.sh b/scripts/install.sh index 8ba3757..b5fb71a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 28 November 2024 +# Updated : 4 December 2024 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -40,6 +40,7 @@ exitIfNotRoot ./install-yaac.sh ./install-bbs-client.sh ./install-bbs-server.sh +./install-chattervox.sh # Install modems ./install-ardop.sh diff --git a/tests/test-chattervox.sh b/tests/test-chattervox.sh new file mode 100755 index 0000000..13f1d4d --- /dev/null +++ b/tests/test-chattervox.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 4 December 2024 +# Purpose : Test chattervox installation + +OUT=$(chattervox -v | grep "0.7.0") +exit $?