summaryrefslogtreecommitdiff
path: root/pm/sleep.d/50modules
blob: 338529b1ec32e5fa5e73ba59882d8cb159e81c71 (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
#!/bin/sh

. "${PM_FUNCTIONS}"

suspend_modules()
{
	[ -z "$SUSPEND_MODULES" ] && return $NA
	for x in $SUSPEND_MODULES ; do
		modunload $x
	done
	return 0
}

resume_modules()
{
	modreload
}

case "$1" in
	hibernate|suspend)
		suspend_modules
		;;
	thaw|resume)
		resume_modules
		;;
	*) exit $NA
		;;
esac