Merge pull request #241 from femtofox/main

update branch to match main
This commit is contained in:
Tom 2025-01-23 16:57:49 +00:00 • committed by GitHub
commit a7c167550c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 3 deletions

View file

@ -86,7 +86,7 @@ networking_settings() {
choice=$(dialog --no-collapse --cancel-label "Back" --title "Enable/disable Wi-Fi" --menu "Tip: Wi-Fi can also be toggled by short-pressing the BOOT button on the Luckfox." 13 50 5 \
1 "Turn Wi-Fi on" \
2 "Turn Wi-Fi off" \
"" ""
"" "" \
3 "Return to previous menu" 3>&1 1>&2 2>&3)
exit_status=$? # This line checks the exit status of the dialog command
if [ $exit_status -ne 0 ]; then # Exit the loop if the user selects "Cancel" or closes the dialog

View file

@ -120,10 +120,12 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then
timezone) timezone=$(escape_sed "$value") ;;
meshtastic_url) meshtastic_url=$(escape_sed "$value") ;;
meshtastic_legacy_admin) meshtastic_legacy_admin=$(escape_sed "$value") ;;
meshtastic_public_key) meshtastic_public_key=$(escape_sed "$value") ;;
meshtastic_private_key) meshtastic_private_key=$(escape_sed "$value") ;;
meshtastic_admin_key) meshtastic_admin_key=$(escape_sed "$value") ;;
dont_run_if_log_exists) dont_run_if_log_exists=$(escape_sed "$value") ;;
esac
done < <(grep -E '^(wifi_ssid|wifi_psk|wifi_country|meshtastic_lora_radio|timezone|meshtastic_url|meshtastic_legacy_admin|meshtastic_admin_key|dont_run_if_log_exists)=' "$usb_config")
done < <(grep -E '^(wifi_ssid|wifi_psk|wifi_country|meshtastic_lora_radio|timezone|meshtastic_url|meshtastic_legacy_admin|meshtastic_public_key|meshtastic_private_key|meshtastic_admin_key|dont_run_if_log_exists)=' "$usb_config")
# Check if the log exits and if the dont_run_if_log_exists line is set in the script
if $log_exists && [[ $dont_run_if_log_exists = "true" ]]; then
@ -222,7 +224,21 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then
log_message "Updating Meshtastic URL."
found_config="true"
fi
if [[ -n "$meshtastic_public_key" ]]; then
meshtastic_public_key="$(echo "$meshtastic_public_key" | sed 's/\\//g')" # remove weirdo windows characters
log_message "Updating Meshtastic public key."
found_config="true"
meshtastic_security_command+=" -U \"$meshtastic_public_key\"" # add to the command list
fi
if [[ -n "$meshtastic_private_key" ]]; then
meshtastic_private_key="$(echo "$meshtastic_private_key" | sed 's/\\//g')" # remove weirdo windows characters
log_message "Updating Meshtastic private key."
found_config="true"
meshtastic_security_command+=" -R \"$meshtastic_private_key\"" # add to the command list
fi
if [[ -n "$meshtastic_admin_key" ]]; then
meshtastic_admin_key=$(echo "$meshtastic_admin_key" | sed 's/\\//g') # remove weirdo windows characters
if [ "$meshtastic_admin_key" = "clear" ]; then