PDA

View Full Version : Restarting networking after apm induced suspend.



fishd
01-31-2004, 07:59 PM
Hi,
I've got a hard disk install of knoppix on my Portege 3480, I'm using a Cardbus Xircom Realport ethernet adapter and it's running great.

I've installed Toshutils to handle the advanced power management stuff and that works too, so that when I close the lid of the laptop it automatically goes to sleep (I assume a "suspend").

The problem I have is that when I open the lid of the laptop my networking doesn't restart.

I've tried creating a script called "networking" in /etc/apm/event.d and making it executable with "chmod 755 networking". Contents of script below:


#! /bin/sh
if [ "$1" = suspend ]; then
/etc/init.d/networking stop
elif [ "$1" = resume ] && [ "$2" != standby ]; then
/etc/init.d/networking restart
fi

I got this from a combination of 00hwclock in /etc/apm/event.d and hunting around on the net. Problem is, that it doesn't seem to work.

Questions:
1.) How can I check if my script is actually being executed when the laptop resumes?
2.) Assuming it is actually running, is this script correct/suitable?

Thanks !