Handle the network connection on suspend/resume


Please note that this blog has been moved.

Now it has its own domain: mynixworld.info🙂

If you want to read the latest version of this article (recommended) please click here and I open the page for you.

Whenever I have suspend/resumed my Gentoo system I found my wifi network status as started but actually not working.

I guess that standby/hibernate/suspend is handled by sys-power/pm-utils, whici is very well described here, I can make use of it to fix the problem discussed above:

  • create a /etc/pm/sleep.d/50wifi (with +x permission) with the following code:
#!/bin/bash
case $1 in
suspend)
echo "Stopping wifi"
/etc/init.d/net.wlan0 stop > /dev/null
;;
resume)
echo "Starting wifi"
/etc/init.d/net.wlan0 start > /dev/null
;;
esac

About Eugen Mihailescu

Always looking to learn more about *nix world, about the fundamental concepts of arithmetic, algebra and geometry. I am also passionate about programming, database and systems administration.
This entry was posted in linux and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s