summaryrefslogtreecommitdiff
path: root/pm/sleep.d/50modules
blob: 5b3a1843e1153cefafbceae37258fac2ddf74919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 $?