mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-29 19:37:20 -05:00
Added an error handler from Josh.
Checks to make sure meshtastic is running and responsive.
This commit is contained in:
parent
1f27aef225
commit
222180fcba
1 changed files with 6 additions and 0 deletions
|
|
@ -17,6 +17,12 @@ get_mobile_wifi_state() {
|
|||
set_mobile_wifi_state() {
|
||||
local state="$1"
|
||||
local meshtastic_output
|
||||
|
||||
if [[ "$(meshtastic --host 127.0.0.1 --get network.wifi_enabled 2>&1 | grep -i refused)" ]] || [[ ! "$(meshtastic --host 127.0.0.1 --get network.wifi_enabled)" ]]; then
|
||||
log "Error connecting to MeshtasticD. Aborting."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ "$state" == "up" ]]; then
|
||||
meshtastic_output=$(meshtastic --host 127.0.0.1 --set network.wifi_enabled true 2>&1)
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue