summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats/data
diff options
context:
space:
mode:
authorJonathan Bauer2018-03-08 13:57:42 +0100
committerJonathan Bauer2018-03-08 13:57:42 +0100
commit4d1d76579c9a88f891a595fb3fab83b23ea17cc2 (patch)
tree879c51286600ab7be059ccd223a684aaf49b1f09 /core/modules/hardware-stats/data
parent[vbox-src] add missing dependencies on base ubuntus (diff)
downloadmltk-4d1d76579c9a88f891a595fb3fab83b23ea17cc2.tar.gz
mltk-4d1d76579c9a88f891a595fb3fab83b23ea17cc2.tar.xz
mltk-4d1d76579c9a88f891a595fb3fab83b23ea17cc2.zip
[hardware-stats] check if '--no-legend' is needed
before using loginctl
Diffstat (limited to 'core/modules/hardware-stats/data')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
index 8a8bc642..bbcf8494 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
@@ -12,7 +12,10 @@ UUID=$(cat "/etc/system-uuid")
USED=0
Name=
-for SESSION in $(loginctl | awk '{print $1}'); do
+# detect if we need '--no-legend' or not...
+LEGEND=
+loginctl --help 2>&1 | grep -q -- '--no-legend' && LEGEND="--no-legend"
+for SESSION in $(loginctl $LEGEND | awk '{print $1}'); do
unset Display Remote State
eval $(loginctl -p Display -p Remote -p State -p Class -p Name show-session "$SESSION")
if [ "$Display" = ":0" ] && [ "$Remote" = "no" ] && [ "$State" = "active" -o "$State" = "online" ] && [ "$Class" = "user" ]; then