#!/sbin/openrc-run
name="fix-suspend"
description="fixes instant wakeups from suspend by disabling PTXH in /proc/acpi/wakeup"
command="/bin/bash"
command_args="-c 'echo PTXH > /proc/acpi/wakeup'"
pidfile="/var/run/${RC_SVCNAME}.pid"

start(){
  ebegin "Starting fix-suspend"
  /bin/bash -c 'echo PTXH > /proc/acpi/wakeup'
  eend "${?}"
}

stop(){
  ebegin "Stopping fix-suspend"
  /bin/bash -c 'echo PTXH > /proc/acpi/wakeup'
  eend "${?}"
}

status(){
  einfo "this service is not a background process, it runs as you start and stop it"
}