-
-
Save spvkgn/5c3632541e43fdc1db23c7eb170cec93 to your computer and use it in GitHub Desktop.
Ubuntu 16.04 systemd unload modules on sleep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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: | |
# https://bbs.archlinux.org/viewtopic.php?pid=1540125#p1540125 | |
# More info: | |
# https://ubuntuforums.org/showthread.php?t=2314905&p=13555828#post13555828 | |
case $1 in | |
pre) | |
for mod in $(</etc/suspend-modules.conf); do | |
rmmod $mod | |
done | |
;; | |
post) | |
for mod in $(</etc/suspend-modules.conf); do | |
modprobe $mod | |
done | |
;; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r8169 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment