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

. "${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