summaryrefslogtreecommitdiff
path: root/pm/sleep.d/50modules
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2008-01-26 18:06:26 +0000
committerRichard Hughes <richard@hughsie.com>2008-01-26 18:06:26 +0000
commitde1ace906a3c99b01996b7a0e8dfabcabf0262c9 (patch)
tree505d9702a4f38c0dafced0157307ae67b0e7f736 /pm/sleep.d/50modules
parent67645abd5351105a1d18f8615e789c4234e0d480 (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-xpm/sleep.d/50modules33
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 $?