Wi-Fi stops working after waking up from sleep

THE SOLUTION:
Open the terminal and enter:

sudo nano /usr/lib/systemd/system-sleep/wifisleep.sh

Then copy and paste the following:

#!/usr/bin/env bash
case ${1} in
pre)
rfkill block all
echo “Killed wifi/bluetooth”
;;
post)
rfkill unblock all
echo “Started wifi/bluetooth”
;;
esac

Press Ctrl + X, it will then prompt you to save, press the Y key, and then press the Enter key. Now that the terminal is back to normal, enter the following command:

sudo chmod +x wifisleep.sh

Reboot the computer and enter the following command, which will put the computer to sleep:

systemctl suspend

Now retry putting the computer to sleep the way you usually do (power button, CTRL + ALT + DELETE, or application menu). It should all work now. Thank you to @OrsoBruno for the help, and @jsmith64 for the script.

4 Likes