mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
Chat - Added support for adding the newly generated singing key to the chattervox configuration on first start
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Author : Gaston Gonzalez
|
# Author : Gaston Gonzalez
|
||||||
# Date : 5 December 2024
|
# Date : 5 December 2024
|
||||||
|
# Updated : 6 December 2024
|
||||||
# Purpose : Wrapper script for starting chattervox with PnP support
|
# Purpose : Wrapper script for starting chattervox with PnP support
|
||||||
#
|
#
|
||||||
# Preconditions:
|
# Preconditions:
|
||||||
@@ -9,11 +10,12 @@
|
|||||||
# 2. Dire Wolf is started
|
# 2. Dire Wolf is started
|
||||||
#
|
#
|
||||||
# Postconditions:
|
# Postconditions:
|
||||||
# 1. Callsign and KISS host updated
|
# 1. On first start, configuration is created and signing key is generated.
|
||||||
# 2. chattervox is started
|
# 2. chattervox is started
|
||||||
|
|
||||||
CHATTERVOX_CONF_DIR=${HOME}/.chattervox
|
CHATTERVOX_CONF_DIR=${HOME}/.chattervox
|
||||||
CHATTERVOX_CONF_FILE=${CHATTERVOX_CONF_DIR}/config.json
|
CHATTERVOX_CONF_FILE=${CHATTERVOX_CONF_DIR}/config.json
|
||||||
|
CHATTERVOX_KEYSTORE_FILE=${CHATTERVOX_CONF_DIR}/keystore.json
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "usage: $(basename $0) <command>"
|
echo "usage: $(basename $0) <command>"
|
||||||
@@ -87,6 +89,26 @@ cat <<EOF > "${CHATTERVOX_CONF_FILE}"
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
et-log "Generating signing key..."
|
||||||
|
chattervox genkey
|
||||||
|
|
||||||
|
SIGNING_KEY=$(cat ${CHATTERVOX_KEYSTORE_FILE} | jq -e -r .${CALLSIGN}[0].public)
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
et-log "Adding signing key configuration..."
|
||||||
|
|
||||||
|
cat <<EOF > "${CHATTERVOX_CONF_FILE}"
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"callsign": "${CALLSIGN}",
|
||||||
|
"ssid": 0,
|
||||||
|
"keystoreFile": "${HOME}/.chattervox/keystore.json",
|
||||||
|
"kissPort": "kiss://localhost:8001",
|
||||||
|
"kissBaud": 9600,
|
||||||
|
"feedbackDebounce": 20000,
|
||||||
|
"signingKey": "${SIGNING_KEY}"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user