summaryrefslogtreecommitdiffstats
path: root/scripts/check-uptime/fetch.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/check-uptime/fetch.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/check-uptime/fetch.py b/scripts/check-uptime/fetch.py
new file mode 100755
index 0000000..c1cceff
--- /dev/null
+++ b/scripts/check-uptime/fetch.py
@@ -0,0 +1,7 @@
+#!/usr/bin/python3
+import crm_script
+try:
+ uptime = open('/proc/uptime').read().split()[0]
+ crm_script.exit_ok(uptime)
+except Exception as e:
+ crm_script.exit_fail("Couldn't open /proc/uptime: %s" % (e))