If meshtasticd service does not launch and wifi in meshtastic is set to off, wifi will now default to active.

This commit is contained in:
nagumii 2024-12-12 00:09:17 +02:00
parent 47b9d98833
commit bd8cdb8ecd

View file

@ -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}')
@ -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