From 063d09d8438cb25e7212d3b656f2eba4f2b4622b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 11 Apr 2024 19:43:14 +0200 Subject: computer-time-limit: shut down computer if user is not logged out after 1 minute --- computer-time-limit | 6 ++++++ 1 file changed, 6 insertions(+) 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' -- cgit v1.2.3-70-g09d2