diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh index d2803e5..7fe9b4d 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh @@ -93,16 +93,8 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then update_wifi="false" wifi_command="femto-network-config.sh" meshtastic_security_command="femto-meshtasticd-config.sh" - - # Check if the log exits and if the dont_run_config_if_log_exists line is set in the script - if [[ log_exists && -n "$dont_run_config_if_log_exists" ]]; then - log_message "log exists and script is set to exit" - for _ in {1..5}; do #boot code - blink "1.5" && sleep 0.5 - done - exit_script 0 - fi - + dont_run_config_if_log_exists="false" + # Escape and read the fields from the USB config file if they exist while IFS='=' read -r key value; do value=$(echo "$value" | tr -d '"') @@ -115,9 +107,18 @@ 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") ;; esac done < <(grep -E '^(wifi_ssid|wifi_psk|wifi_country|meshtastic_lora_radio|timezone|meshtastic_url|meshtastic_legacy_admin|meshtastic_admin_key)=' "$usb_config") + # Check if the log exits and if the dont_run_config_if_log_exists line is set in the script + if [[ $log_exists="true" && $dont_run_config_if_log_exists="true" ]]; then + log_message "log exists and script is set to exit" + for _ in {1..5}; do #boot code + blink "1.5" && sleep 0.5 + done + exit_script 1 + fi # Update wpa_supplicant.conf with the new values, if specified if [[ -n "$wifi_country" ]]; then