Skip to content

Instantly share code, notes, and snippets.

@petersaints
petersaints / 10-fix-proc-acpi-wakeup.sh
Last active April 11, 2017 23:09 — forked from kepi/45fix-usb-wakup.sh
Disable resume when certain devices (e.g., USB) become active
#!/bin/bash
# (/usr)/lib/systemd/system-sleep/10-fix-proc-acpi-wakeup.sh
# Disable resume when certain devices (e.g., USB) become active.
# Based on: https://gist.github.com/kepi/9dea7aee8a59f3e7c10a
[[ "$1" = "pre" ]] || exit 0
function print_state {
cat /proc/acpi/wakeup | grep $1 | cut -f3 | cut -d' ' -f1 | tr -d '*'