summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update b/core/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update
index 31ac01a3..6df22843 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/shutdown-system_usage_update
@@ -1,5 +1,8 @@
#!/bin/ash
+# Already done/running? Consider success
+mkdir /run/openslx/shutdown.mutex || exit 0
+
. /opt/openslx/config
[ -z "$SLX_REMOTE_LOG" ] && exit 0
@@ -7,6 +10,7 @@ UUID=$(cat /etc/system-uuid)
[ -z "$UUID" ] && exit 1
-curl --retry 3 --retry-connrefused --max-time 3 --retry-max-time 10 -s --data-urlencode "type=~poweroff" --data-urlencode "uuid=$UUID" \
+curl --retry 3 --retry-connrefused --max-time 3 --retry-max-time 10 -s \
+ --data-urlencode "type=~poweroff" --data-urlencode "uuid=$UUID" \
"$SLX_REMOTE_LOG"