#!/bin/bash set -u for device in $(awk '$3 == "enabled" {print $1}' /proc/acpi/wakeup); do echo "$device" echo "$device" > /proc/acpi/wakeup done