summarylogtreecommitdiffstats
path: root/suspend-modules
blob: b272c4ebbc4de5f203b1bec36d94a9f4c964acee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

readarray -t modules < /etc/suspend-modules.conf

case $1 in
  pre)
    # unload modules before sleeping
    for mod in "${modules[@]}"; do
      modprobe -r $mod
    done
  ;;
  post)
    # load modules back after sleep
    for mod in "${modules[@]}"; do
      modprobe $mod
    done
  ;;
esac