summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-04-11 19:43:14 +0200
committerErich Eckner <git@eckner.net>2024-04-11 19:43:14 +0200
commit063d09d8438cb25e7212d3b656f2eba4f2b4622b (patch)
tree424f004b008dba9b6237792f9b52b53ca9a5d125
parent5c6ee645a4c9d5064750bafd3aed3a5be9270d49 (diff)
downloadcomputer-time-limit-063d09d8438cb25e7212d3b656f2eba4f2b4622b.tar.xz
computer-time-limit: shut down computer if user is not logged out after 1 minute
-rwxr-xr-xcomputer-time-limit6
1 files changed, 6 insertions, 0 deletions
diff --git a/computer-time-limit b/computer-time-limit
index e072d62..80fc98c 100755
--- a/computer-time-limit
+++ b/computer-time-limit
@@ -56,6 +56,12 @@ check_time() {
if [ "${noch}" -le 0 ]; then
sende_msg stop "$2" >/dev/null
loginctl terminate-user "$1"
+ (
+ sleep 1m
+ if is_logged_in "${user}"; then
+ poweroff
+ fi
+ )&
fi
if [ "${noch}" -lt 3630 ] && [ "${noch}" -gt 3570 ]; then
espeak-ng -vde -w /tmp/stunde.wav 'noch eine Stunde'