L

On-Suspend scripts in Ubuntu 9.10

Jan. 7th 2010 19:25:47

My thinkpad works pretty well in Ubuntu 9.10, but one thing thing that is not fixed is that my wireless ceases to function when I resume. If you remove and reinsert the kernel module for it, it will work again. Back in the day, you'd put this in /etc/apm/resume.d/, or more recent, in /etc/acpi/resume.d/, but as with other seemingly fine technologies Ubuntu has recently deprecated ACPI. The new location for the script is /etc/pm/sleep.d/.

As before, when your computer suspends, the script is called with "suspend" as the first argument, and when you resume, the script is called with "resume" as the first argument. Here's a quick script that did what I want, easily adaptable to your need:

#!/bin/sh

case "$1" in
    resume)
    modprobe -r ath_pci
    modprobe ath_pci
    ;;
esac

comments

+ leave a comment on "On-Suspend scripts in Ubuntu 9.10"