Skip to content

Instantly share code, notes, and snippets.

@nmunson
Created November 4, 2012 14:58
Show Gist options
  • Save nmunson/4012196 to your computer and use it in GitHub Desktop.
Save nmunson/4012196 to your computer and use it in GitHub Desktop.
XBMC box rc.local file for waking from suspend
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
status=`cat /proc/acpi/wakeup | grep "USB0" | awk {'print $3}'`
if [ "$status" = "disabled" -o "$status" = "*disabled" ]; then
echo "USB0" > /proc/acpi/wakeup
fi
status=`cat /proc/acpi/wakeup | grep "USB2" | awk {'print $3}'`
if [ "$status" = "disabled" -o "$status" = "*disabled" ]; then
echo "USB2" > /proc/acpi/wakeup
fi
sudo sh -c "echo enabled> /sys/bus/usb/devices/2-6/power/wakeup"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment