mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-20 23:16:30 -05:00
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:
parent
47b9d98833
commit
bd8cdb8ecd
1 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue