Skip to content

Instantly share code, notes, and snippets.

Forked from anonymous/suspend-modules
Last active November 5, 2022 10:28
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Ubuntu 16.04 systemd unload modules on sleep
# Put into /lib/systemd/system-sleep/suspend-modules
# chmod a+x /lib/systemd/system-sleep/suspend-modules
# Create /etc/suspend-modules.conf
# with one module per line
# credits to:
# More info:
case $1 in
for mod in $(</etc/suspend-modules.conf); do
rmmod $mod
for mod in $(</etc/suspend-modules.conf); do
modprobe $mod
Copy link

sigboe commented Dec 6, 2017

If you use

$(awk 1 /etc/suspend-modules/*.conf)

Then you can do this for all .conf files in /etc/suspend-modules/ which seams to be a more modern best practice way to do settings now.

Copy link

instead of rmmod, I would use modprobe -r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment