summaryrefslogtreecommitdiffstats
path: root/scripts/check-uptime/fetch.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
commitd835b2cae8abc71958b69362162e6a70c3d7ef63 (patch)
tree81052e3d2ce3e1bcda085f73d925e9d6257dec15 /scripts/check-uptime/fetch.py
parentInitial commit. (diff)
downloadcrmsh-d835b2cae8abc71958b69362162e6a70c3d7ef63.tar.xz
crmsh-d835b2cae8abc71958b69362162e6a70c3d7ef63.zip
Adding upstream version 4.6.0.upstream/4.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/check-uptime/fetch.py')
-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))