mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-26 01:46:34 -05:00
Update femto-usb-config-tool.sh
Added a check for `dont_run_config_if_log_exists`
This commit is contained in:
parent
46a4829ea3
commit
10e4c116f7
1 changed files with 15 additions and 0 deletions
|
|
@ -71,6 +71,12 @@ fi
|
|||
wpa_supplicant_conf="/etc/wpa_supplicant/wpa_supplicant.conf"
|
||||
usb_config="/tmp/femtofox-config.txt"
|
||||
|
||||
# Check if the mounted USB drive contains a file femtofox-config.log
|
||||
if [ -f "$mount_point/femtofox-config.log" ]; then
|
||||
log_message "femtofox-config.log found on USB drive."
|
||||
log_exists=true
|
||||
fi
|
||||
|
||||
# Check if the mounted USB drive contains a file femtofox-config.txt
|
||||
if [ -f "$mount_point/femtofox-config.txt" ]; then
|
||||
log_message "femtofox-config.txt found on USB drive."
|
||||
|
|
@ -88,6 +94,15 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then
|
|||
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
|
||||
|
||||
# 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 '"')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue