From 4a0697a0e19fcf7b19abbabffb14cba33aee3491 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 25 Jan 2024 00:56:34 +0100 Subject: Naive approach that seems to work with mayohiga One of the important flaws is that if one of the intended services will not run, then shutdown may not happen at all. With current mayohiga setup this will not happen but it may break in any other case. --- shutdown-if-no-sessions | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 shutdown-if-no-sessions (limited to 'shutdown-if-no-sessions') diff --git a/shutdown-if-no-sessions b/shutdown-if-no-sessions new file mode 100755 index 0000000..285eb70 --- /dev/null +++ b/shutdown-if-no-sessions @@ -0,0 +1,4 @@ +#!/bin/sh +if ! who | grep -e tty -e pts; then + systemctl poweroff +fi -- cgit v1.1