diff options
author | Richard Hughes <richard@hughsie.com> | 2008-01-26 18:06:26 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2008-01-26 18:06:26 +0000 |
commit | de1ace906a3c99b01996b7a0e8dfabcabf0262c9 (patch) | |
tree | 505d9702a4f38c0dafced0157307ae67b0e7f736 /pm/sleep.d/50modules | |
parent | 67645abd5351105a1d18f8615e789c4234e0d480 (diff) |
rename hooks into sleep.d -- this is something we have wanted to
do for a long time, but CVS made it hard
Diffstat (limited to 'pm/sleep.d/50modules')
-rwxr-xr-x | pm/sleep.d/50modules | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pm/sleep.d/50modules b/pm/sleep.d/50modules new file mode 100755 index 0000000..5b3a184 --- /dev/null +++ b/pm/sleep.d/50modules @@ -0,0 +1,33 @@ +#!/bin/bash + +. /usr/lib/pm-utils/functions + +suspend_modules() +{ + [ -z "$SUSPEND_MODULES" ] && return 0 + for x in $SUSPEND_MODULES ; do + modunload $x + done + return 0 +} + +resume_modules() +{ + [ -z "$RESUME_MODULES" ] && return 0 + for x in $RESUME_MODULES ; do + modprobe $x + done +} + +case "$1" in + hibernate|suspend) + suspend_modules + ;; + thaw|resume) + resume_modules + ;; + *) + ;; +esac + +exit $? |