summaryrefslogtreecommitdiff
path: root/shutdown-if-no-sessions
diff options
context:
space:
mode:
Diffstat (limited to 'shutdown-if-no-sessions')
-rwxr-xr-xshutdown-if-no-sessions4
1 files changed, 4 insertions, 0 deletions
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