Skip to content

Instantly share code, notes, and snippets.

@npcardoso
Created June 10, 2014 14:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npcardoso/47d8f45505ccbdb52581 to your computer and use it in GitHub Desktop.
Save npcardoso/47d8f45505ccbdb52581 to your computer and use it in GitHub Desktop.
A script to enable/disable all acpi wakeup events
#!/bin/bash
if [[ $# > 1 || ($1 != "enable" && $1 != "disable") ]]; then
echo "Usage: $0 <enable|disable>"
exit 1
fi
if [[ $1 == "enable" ]]; then
TOGGLE=`grep '\*disabled' /proc/acpi/wakeup | cut -d ' ' -f1`
else
TOGGLE=`grep '\*enabled' /proc/acpi/wakeup | cut -d ' ' -f1`
fi
for DEV in $TOGGLE; do
echo $DEV
echo $DEV > /proc/acpi/wakeup
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment