Created
July 13, 2024 23:09
-
-
Save SaBenBurra/f1ff7340cb3606521a2b2949eba9f50b to your computer and use it in GitHub Desktop.
no_wakeup_usb.service
This file contains 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
grep -f <(lspci | grep USB | cut -d " " -f 1) \ | |
<(cat /proc/acpi/wakeup) | cut -c 1-4 | tr -d '\t' \ | |
| sed -e 's|^|echo |' -e 's|$| > /proc/acpi/wakeup|' -e '1s|^|#!/bin/bash\n|' \ | |
| sudo tee /usr/local/bin/nowakeupusb >/dev/null \ | |
&& sudo chmod +x /usr/local/bin/nowakeupusb && printf '%s\n' '[Unit]' \ | |
'Description=no-wakeup-usb' '[Service]' \ | |
'ExecStart=/usr/local/bin/nowakeupusb' \ | |
'[Install]' 'WantedBy=multi-user.target' \ | |
| sudo tee /etc/systemd/system/no_wakeup_usb.service >/dev/null \ | |
&& sudo systemctl enable no_wakeup_usb.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment