Luthfi Idris Cerita Linux, Jerman Wirausaha dan Hidup Sederhana

Re-enable wireless after hibernate

This time i want to write in English. I don’t care if it gramatically is wrong or not. I just want to write in English now. After I installed ElementaryOS Freya, each time I resume from hibernate the networking is disable. Even after I enable, still networking not working. I tried to get IP from dhclient wlan0 and ifconfig wlan0 down and ifconfig wlan0 up also not working. I duckduckgoed little bit and i found the solution.

Check the state before hibernate with nmcli nm command and the result like this:

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         connected       enabled         enabled    enabled         enabled

And after hibernate:

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         asleep          enabled         enabled    enabled         disabled

You see, even the wifi is already enable, the state still sleep. To wake it up, use this command

sudo nmcli nm sleep false 

To make it permanent, create this script named wakeup.sh in /etc/pm/sleep.d/ as follow:

#!/bin/sh

case "${1}" in
    resume|thaw)
    nmcli nm sleep false
            ;;
esac

Save it and hibernate to see the difference. This script also works for Ubuntu 14.04. Ok, that’s it. Ciao Bella.

source: This link

« Pos Sebelumnya Pos Sesudahnya »