mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
Winlink - Initial support for setting Winlink passwd
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user