Winlink - Initial support for setting Winlink passwd

This commit is contained in:
Gaston Gonzalez
2024-11-04 16:47:24 -07:00
parent 0feede9d3c
commit dc2e5feafd
3 changed files with 16 additions and 13 deletions
+10 -5
View File
@@ -1,8 +1,9 @@
#!/bin/bash
#
# Author : Gaston Gonzalez
# Date : 25 October 2024
# Purpose : Set user-specific settings for EmComm Tools.
# Author : Gaston Gonzalez
# Date : 25 October 2024
# Updated: 4 November 2024
# Purpose: Set user-specific settings for EmComm Tools.
[ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json"
@@ -12,18 +13,22 @@ fi
CUR_CALLSIGN=$(cat ${ET_USER_CONFIG} | jq -r .callsign)
CUR_GRID=$(cat ${ET_USER_CONFIG} | jq -r .grid)
CUR_WINLINK_PASSWD=$(cat ${ET_USER_CONFIG} | jq -r .winlinkPasswd)
while true; do
read -e -p "Enter your callsign (current: ${CUR_CALLSIGN}): " callsign
read -e -p "Enter your maidenhead grid square (current: ${CUR_GRID}): " grid
read -e -p "Enter your Winlink password: " winlink_passwd
callsign=${callsign:-"$CUR_CALLSIGN"}
grid=${grid:-"$CUR_GRID"}
winlink_passwd=${winlink_passwd:-"$CUR_WINLINK_PASSWD"}
echo
echo "Is the following correct?:"
echo "Callsign: $callsign"
echo "Grid Square: $grid"
echo "Winlink Password: *******"
read -p "(y/n): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
@@ -31,12 +36,12 @@ while true; do
cat <<EOF > "${ET_USER_CONFIG}"
{
"callsign": "${callsign}",
"grid": "${grid}"
"grid": "${grid}",
"winlinkPasswd": "${winlink_passwd}"
}
EOF
echo "User settings updated..."
cat ${ET_USER_CONFIG} | jq .
break
elif [[ "$confirm" =~ ^[Nn]$ ]]; then
echo "Let's try again."