Turn WiFi off before suspend

This might help avoiding stability issues with WiFi.
This commit is contained in:
Xavier Del Campo Romero 2023-03-30 01:53:49 +02:00
parent 8556aecc46
commit f85518f034
Signed by: xavi
GPG Key ID: 84FF3612A9BF43F2
1 changed files with 7 additions and 0 deletions

View File

@ -42,6 +42,8 @@ start_deep_sleep() {
sleep 5 # Give some extra time for pending output data
if [ can_suspend ]; then
WIFI_WAS_ON=$(nmcli r wifi)
nmcli r wifi off
echo mem > /sys/power/state 2>/dev/null
fi
@ -210,6 +212,11 @@ if [ "$1" == "start" ]; then
break
fi
done
if [ "$WIFI_WAS_ON" = "enabled" ]; then
nmcli r wifi on
fi
wait_for_notifications
done
elif [ "$1" == "stop" ]; then