wifi mesh control checks for wlan0 existence

If wlan0 does not exist, do nothing,
This commit is contained in:
Ruledo 2025-01-16 02:11:33 -08:00 • committed by GitHub
parent 7e133b54d1
commit 0528e075eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,8 +67,8 @@ monitor_changes() {
while true; do
PID=$(ps -C meshtasticd -o pid= | tr -d ' ')
if [[ -n "$PID" ]] && sudo lsof /dev/spidev0.0 | grep -q "$PID"; then
#if sudo lsof /dev/spidev0.0 | grep -q "meshtasticd"; then
#if [[ -n "$PID" ]] && sudo lsof /dev/spidev0.0 | grep -q "$PID"; then
if [[ -n "$PID" ]] && sudo lsof /dev/spidev0.0 | grep -q "$PID" && [[ -d /sys/class/net/wlan0 ]]; then
local current_mobile_state current_wlan_state
current_mobile_state=$(get_mobile_wifi_state)
current_wlan_state=$(cat /sys/class/net/wlan0/operstate)