summaryrefslogtreecommitdiffstats
path: root/remote/modules/hardware-stats/data/opt/openslx/scripts
diff options
context:
space:
mode:
authorSimon Rettberg2015-12-07 17:23:47 +0100
committerSimon Rettberg2015-12-07 17:23:47 +0100
commit6be3bc0e4056e75b22526e4597dd18b7f1c89d8f (patch)
tree88c3f45c5a3a8589ecbc23e2e89cc9c71efb22cb /remote/modules/hardware-stats/data/opt/openslx/scripts
parent[hardware-stats] Fix usage stats updater (diff)
downloadtm-scripts-6be3bc0e4056e75b22526e4597dd18b7f1c89d8f.tar.gz
tm-scripts-6be3bc0e4056e75b22526e4597dd18b7f1c89d8f.tar.xz
tm-scripts-6be3bc0e4056e75b22526e4597dd18b7f1c89d8f.zip
[hardware-stats] Report system shutdown
Diffstat (limited to 'remote/modules/hardware-stats/data/opt/openslx/scripts')
-rwxr-xr-xremote/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update12
1 files changed, 12 insertions, 0 deletions
diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update b/remote/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update
new file mode 100755
index 00000000..dc9f8f73
--- /dev/null
+++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update
@@ -0,0 +1,12 @@
+#!/bin/ash
+
+. /opt/openslx/config
+[ -z "$SLX_REMOTE_LOG" ] && exit 0
+
+UUID=$(cat /run/system-uuid)
+
+[ -z "$UUID" ] && exit 1
+
+curl -s --data-urlencode "type=~poweroff" --data-urlencode "uuid=$UUID" \
+ "$SLX_REMOTE_LOG" > /dev/null 2>&1
+