login
v2
v1

jmoiron.net

On-Suspend scripts in Ubuntu 9.10

posted January 7th, 2010 @ 19:25:47

- tags: general tech

- comments: 1

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

Alexander said at 04:11 on Feb. 13th:

Thanks for the script, really helpful!

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