Merge pull request #261 from femtofox/new_working

Fix bug with meshtastic node info in menus
This commit is contained in:
noon92 2025-01-28 01:09:28 +02:00 • committed by GitHub
commit 1ab06664a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 16 deletions

View file

@ -167,7 +167,7 @@ utilities() {
case $option in
1)
while true; do
choice=$(dialog --no-collapse --extra-button --extra-label "Help" --cancel-label "Back" --menu "System info" 17 40 5 \
choice=$(dialog --no-collapse --help-button --help-label "Help" --cancel-label "Back" --menu "System info" 17 40 5 \
1 "CPU" \
2 "Operating system" \
3 "Storage & memory" \
@ -181,7 +181,7 @@ utilities() {
exit_status=$? # This line checks the exit status of the dialog command
if [ $exit_status -eq 1 ]; then # Exit the loop if the user selects "Cancel" or closes the dialog
break
elif [ $exit_status -eq 3 ]; then # Help ("extra") button
elif [ $exit_status -eq 2 ]; then # Help ("extra") button
dialog --no-collapse --colors --title "System info help" --msgbox "To get system info in terminal (where it can be copied), enter \`\Zusudo femto-utils.sh -i\Zn\`." 7 50
else
case $choice in
@ -207,7 +207,7 @@ utilities() {
;;
6) # Meshtastic node info)
loading "Loading Meshtastic node info..."
dialog --no-collapse --colors --title "Meshtastic node info" --msgbox "$(replace_colors "$(femto-utils.sh -m)")" 0 0
dialog --no-collapse --colors --title "Meshtastic node info" --msgbox "$(replace_colors "$(femto-meshtasticd-config.sh -i)")" 0 0
;;
7) # Complete system info)
loading "Loading complete system info..."
@ -374,8 +374,8 @@ meshtastic_settings() {
case $option in
1) # view node info)
loading "Getting Node info..."
dialog --no-collapse --colors --title "Node Info" --msgbox "$(replace_colors "$(femto-meshtasticd-config.sh -m)")" 0 0
loading "Getting node info..."
dialog --no-collapse --colors --title "Node info" --msgbox "$(replace_colors "$(femto-meshtasticd-config.sh -i)")" 0 0
;;
2) # get current configuration URL & QR code)
loading "Getting Meshtastic QR code and URL..."

View file

@ -92,6 +92,7 @@ Spread factor: $(echo "$output" | grep -oP '"spreadFactor":\s*\K\w+')\n\
Coding rate: $(echo "$output" | grep -oP '"codingRate":\s*\K\w+')"
fi
echo -e "\
Service status: $(femto-meshtasticd-config.sh -S)\n\
Version: $(echo "$output" | grep -oP '"firmwareVersion":\s*"\K[^"]+' | head -n 1)\n\
Node name: $(echo "$output" | grep -oP 'Owner:\s*\K.*' | head -n 1)\n\
NodeID: !$(printf "%08x\n" $(echo "$output" | grep -oP '"myNodeNum":\s*\K\d+' | head -n 1)) (nodenum: $(echo "$output" | grep -oP '"myNodeNum":\s*\K\d+' | head -n 1))\n\

View file

@ -16,7 +16,6 @@ Options are:
-p Peripherals info
-c CPU info
-n Networking info
-m Meshtastic node info
-o OS info
-S Storage & RAM info
EOF
@ -149,13 +148,6 @@ UART-3 state: $uart3_state\n\
UART-4 state: $uart4_state"
}
meshtastic_info() {
local meshtasticd_service_status="$(femto-meshtasticd-config.sh -S)"
local meshtasticd_info="$(femto-meshtasticd-config.sh -i)"
echo -e "Service status: $meshtasticd_service_status\n\
$meshtasticd_info"
}
all_system_info() {
echo -e "\
Femtofox\n\
@ -175,7 +167,7 @@ $(networking_info)\n\
$(peripherals_info)\n\
\n\
Meshtasticd:\n\
$(meshtastic_info)"
$(femto-meshtasticd-config.sh -i)"
}
# enable/disable/check system logging
@ -200,7 +192,7 @@ logging() {
fi
}
while getopts ":harsl:ipcnmoS" opt; do
while getopts ":harsl:ipcnoS" opt; do
case ${opt} in
h) # Option -h (help)
echo -e $help
@ -225,7 +217,6 @@ while getopts ":harsl:ipcnmoS" opt; do
p) peripherals_info ;; # Option -p (Peripherals info)
c) cpu_info ;; # Option -c (CPU info)
n) networking_info ;; # Option -n (Networing info)
m) meshtastic_info ;; # Option -m (Meshtastic node info)
o) os_info ;; # Option -o (OS info)
S) storage_info ;; # Option -S (Storage & RAM info)
\?) # Unknown option)