Skip to content

Commit

Permalink
If meshtasticd service does not launch and wifi in meshtastic is set …
Browse files Browse the repository at this point in the history
…to off, wifi will now default to active.
  • Loading branch information
noon92 committed Dec 11, 2024
1 parent 47b9d98 commit bd8cdb8
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sleep 60 #wait 60 seconds so networking will be available during boot
previous_value=2

while true; do
if systemctl is-active --quiet meshtasticd; then
# Run the command to fetch the value
current_value=$(cat /root/.portduino/default/prefs/config.proto | protoc --decode_raw | awk '/4 {/, /}/ {if ($1 == "1:") print $2}')

Expand Down Expand Up @@ -39,6 +40,13 @@ while true; do
ip link set wlan0 down
fi

# Wait for 30 seconds before checking again
sleep 30
else
if ip link show wlan0 | grep -q 'state DOWN'; then
ip link set wlan0 up
logger "Wifi mesh control: Meshtasticd service is offline, turning wifi on."
fi
fi

# wait 30 secs before checking again
sleep 30
done

0 comments on commit bd8cdb8

Please sign in to comment.