BBS - Added a BBS Client (Paracon) to et-mode

This commit is contained in:
Gaston Gonzalez
2024-12-03 05:50:39 -07:00
parent edef14e56b
commit 7f445a9216
4 changed files with 109 additions and 2 deletions
@@ -0,0 +1,3 @@
[Setup]
host = localhost
callsign = N0CALL
+8 -1
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 6 November 2024
# Updated : 20 November 2024
# Updated : 3 December 2024
# Purpose : Configures the system for a specific mode of operation
# Use a simple text file to save the state of the last mode selected
@@ -12,6 +12,7 @@ MODE_STATUS_FILE="${HOME}/.config/emcomm-tools/et-mode"
MODE_ID_NONE="none"
MODE_ID_APRS_DIGIPEATER="aprs-digipeater"
MODE_ID_APRS_CLIENT="aprs-client"
MODE_ID_BBS_CLIENT="bbs-client"
MODE_ID_PACKET_DIGIPEATER="packet-digipeater"
MODE_ID_WINLINK_ARDOP="winlink-ardop"
MODE_ID_WINLINK_PACKET="winlink-packet"
@@ -64,6 +65,7 @@ start_and_wait_for_service() {
options=()
options+=("${MODE_ID_NONE}" "No mode selected")
options+=("${MODE_ID_APRS_CLIENT}" "APRS Client (YAAC)")
options+=("${MODE_ID_BBS_CLIENT}" "BBS Client (Paracon)")
options+=("${MODE_ID_APRS_DIGIPEATER}" "APRS Digipeater")
options+=("${MODE_ID_PACKET_DIGIPEATER}" "Packet Digipeater")
options+=("${MODE_ID_WINLINK_ARDOP}" "Winlink over HF (ARDOP)")
@@ -93,6 +95,11 @@ if [ $exit_status -eq 0 ]; then
start_and_wait_for_service et-service-direwolf-simple
et-yaac start
;;
${MODE_ID_BBS_CLIENT})
start_and_wait_for_service et-service-direwolf-simple
et-log "Starting Paracon."
et-paracon start
;;
${MODE_ID_PACKET_DIGIPEATER})
systemctl --user start et-service-direwolf-packet-digipeater
et-log "Packet digipeater now running."
+93
View File
@@ -0,0 +1,93 @@
#!/bin/bash
#
# Author : Gaston Gonzalez
# Date : 3 December 2024
# Purpose : Wrapper script for starting Paracon with PnP support
#
# Preconditions:
# 1. Supported radio and audio interface are connected and properly detected
# 2. Dire Wolf is started
#
# Postconditions:
# 1. Callsign and AGWPE host updated in Paracon
# 2. Paracon is started
PARACON_CONF_DIR=${HOME}/.local/share/emcomm-tools/bbs-client
PARACON_CONF_FILE=${PARACON_CONF_DIR}/paracon.cfg
usage() {
echo "usage: $(basename $0) <command>"
echo " <command>"
echo " start - Start Paracon"
echo " update-config - Update configuration for selected mode"
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
notify_user() {
notify-send \
-t 5000 \
--app-name="EmComm Tools" \
"$1"
}
start() {
update-config
if [ $? -eq 0 ]; then
RIGCTLD_OUT=$(ps -ef | grep [d]irewolf)
if [ $? -ne 0 ]; then
et-log "Can't start Paracon. Dire Wolf not running."
notify_user "Can't start Paracon. Dire Wolf not running."
exit 1
fi
CWD_DIR=$(pwd)
cd ${PARACON_CONF_DIR}
CMD="paracon"
et-log "Starting Paracon in ${PARACON_CONF_DIR} with: ${CMD}"
${CMD}
cd ${CWD_DIR}
else
et-log "Error updating configuration. Can't start Paracon"
exit 1
fi
}
update-config () {
[ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json"
CALLSIGN=$(cat ${ET_USER_CONFIG} | jq -r .callsign)
if [ "${CALLSIGN}" = "N0CALL" ]; then
notify_user "Can't start Paracon. No callsign set. Run: et-user."
exit 1
fi
et-log "Updating Paracon configuration file: ${PARACON_CONF_FILE}..."
sed -i "s|^host.*|host = localhost|" ${PARACON_CONF_FILE}
sed -i "s|^callsign.*|callsign = ${CALLSIGN}|" ${PARACON_CONF_FILE}
}
case $1 in
start)
start
;;
update-config)
update-config
;;
*)
echo "Invalid command."
usage
exit 1
;;
esac
+5 -1
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 6 October 2024
# Updated : 21 November 2024
# Updated : 3 December 2024
# Purpose : Utility script for dumping system information
function usage() {
@@ -176,6 +176,7 @@ case $1 in
MODE_ID_NONE="none"
MODE_ID_APRS_DIGIPEATER="aprs-digipeater"
MODE_ID_BBS_CLIENT="bbs-client"
MODE_ID_PACKET_DIGIPEATER="packet-digipeater"
MODE_ID_APRS_CLIENT="aprs-client"
MODE_ID_WINLINK_ARDOP="winlink-ardop"
@@ -197,6 +198,9 @@ case $1 in
${MODE_ID_APRS_CLIENT})
echo "APRS"
;;
${MODE_ID_BBS_CLIENT})
echo "BBS Client"
;;
${MODE_ID_PACKET_DIGIPEATER})
echo "Packet Digipeater"
;;