I see 'powernap' list in focal (20.04) but diving deeper, I don't see it further than 18.04(???)
On checking for logged in users...
Code:
#!/bin bash
logged_in=$(w | grep -v 'average\|LOGIN@' | awk '{print $1}') ## Check for logged in users, return UserName
if [ -z $logged_in ]
then
echo "No one is logged in"
#systemctl suspend ##hibernate
rtcwake -m disk -s 900 ## Hibernate to disk and wake up in 15 minutes...
else
echo "Users are logged in"
fi
The problem would be to power back on via command line... Using rtcwake, you could wake up in 15 minutes, then check for activity again (cron running this scipt)
Bookmarks