Just realized a dumb mistake I made. The original script from @genosensor has a $wifi
var that is not defined. Me the user should be providing it (found/tested by dumping
$wifi
in the logger debug string)
So effectively i’ve just been using this script from the beginning:
#!/bin/sh
if [ "$1" == "pre" ]; then
rfkill block all
sleep 1
fi
if [ "$1" == "post" ]; then
sleep 1
rfkill unblock all
fi
And it was still effective at making hibernate consistent!
Here is my final version with $wifi
defined - and robust if you want to run with empty var.
#!/bin/sh
# grab this from lspci or lshw (driver=$wifi)
wifi="mt7921e"
logger "$0 - radios $1. wifi: $wifi"
if [ "$1" == "pre" ]; then
rfkill block all
sleep 1
[ -n "$wifi" ] && modprobe -r $wifi
fi
if [ "$1" == "post" ]; then
[ -n "$wifi" ] && modprobe $wifi
sleep 1
rfkill unblock all
fi
Lastly, there are two other related threads that seem to cover same issue.