mirror of
https://github.com/femtofox/femtofox.git
synced 2026-12-04 22:00:21 -05:00
Update femto-usb-config-tool.sh
This commit is contained in:
parent
dd9277c55d
commit
fe45a94850
1 changed files with 7 additions and 3 deletions
|
|
@ -95,10 +95,14 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then
|
|||
update_wifi="false"
|
||||
wifi_command="femto-network-config.sh"
|
||||
meshtastic_security_command="femto-meshtasticd-config.sh"
|
||||
dont_run_config_if_log_exists="false"
|
||||
dont_run_if_log_exists=""
|
||||
|
||||
# Escape and read the fields from the USB config file if they exist
|
||||
while IFS='=' read -r key value; do
|
||||
# Skip lines starting with #
|
||||
if [[ "$key" =~ ^# ]]; then
|
||||
continue
|
||||
fi
|
||||
value=$(echo "$value" | tr -d '"')
|
||||
case "$key" in
|
||||
wifi_ssid) wifi_ssid=$(escape_sed "$value") ;;
|
||||
|
|
@ -109,12 +113,12 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then
|
|||
meshtastic_url) meshtastic_url=$(escape_sed "$value") ;;
|
||||
meshtastic_legacy_admin) meshtastic_legacy_admin=$(escape_sed "$value") ;;
|
||||
meshtastic_admin_key) meshtastic_admin_key=$(escape_sed "$value") ;;
|
||||
dont_run_config_if_log_exists) dont_run_config_if_log_exists=$(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")
|
||||
|
||||
# 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
|
||||
if $log_exists && [[ $dont_run_if_log_exists = "true" ]]; then
|
||||
log_message "log exists and script is set to exit"
|
||||
for _ in {1..2}; do #boot code
|
||||
blink "1.5" && sleep 0.5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue