Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# could probably get this to work with GNU grep but using ripgrep for now
check=$(cat /proc/acpi/wakeup | /usr/bin/rg XHC1 | /usr/bin/rg disabled)
if [[ $check == '' ]]; then
echo "Wakeup from XHC1 is enabled - disabling!"
echo XHC1 > /proc/acpi/wakeup
else
echo "Wakeup from XHC1 is disabled - doing nothing!"
fi
exit 0
[Unit]
Description=FixMacbookSuspend
[Service]
Type=oneshot
ExecStart=/bin/bash /home/danielharper/bin/fix-suspend.sh
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.