kill-enabled.sh
#!/bin/bash
# Check if the script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Disable all enabled wakeup devices
while read -r line; do
device=$(echo "$line" | awk '{print $1}')
status=$(echo "$line" | awk '{print $3}')
if [ "$status" == "*enabled" ]; then
echo "Disabling wakeup device: $device"
echo "$device" > /proc/acpi/wakeup
fi
done < /proc/acpi/wakeup
save the above file then if you are using systemd you can create a service that exec the script
cd /etc/systemd/system
then create the below file
acpi-wake.service
[Unit]
Description=Disable Wakeup Devices
After=multi-user.target
[Service]
Type=oneshot
User=root
Group=root
ExecStart=/home/sacs/kill-enabled.sh
[Install]
WantedBy=multi-user.target
lastly
chmod 777 kill-enabled.sh
sudo systemctl daemon-reload
sudo systemctl start acpi-wake.service
sudo systemctl enable acpi-wake.service