My *nix world

Handle the network connection on suspend / resume

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, which is very well described here, I can make use of it to handle the network connection on suspend / resume.

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

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

The following two tabs change content below.
Handle the network connection on suspend / resume

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
Handle the network connection on suspend / resume

Latest posts by Eugen Mihailescu (see all)

Tagged on: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *