summaryrefslogtreecommitdiffstats
path: root/libexec/fence/functions/status
diff options
context:
space:
mode:
authorDavid Kunz <david.kunz@dknet.ch>2021-07-12 13:37:46 +0000
committerDavid Kunz <david.kunz@dknet.ch>2021-08-24 13:08:31 +0000
commit0539d581dd588e494e6a42ab7335226162652f1e (patch)
tree371ae30a8bbf84ee32d294e49f43ff9aece388d6 /libexec/fence/functions/status
parentdaniels debian directory (temporary!) (diff)
downloadcompute-tools-0539d581dd588e494e6a42ab7335226162652f1e.tar.xz
compute-tools-0539d581dd588e494e6a42ab7335226162652f1e.zip
Adding fencing scripts.
Diffstat (limited to 'libexec/fence/functions/status')
-rwxr-xr-xlibexec/fence/functions/status14
1 files changed, 14 insertions, 0 deletions
diff --git a/libexec/fence/functions/status b/libexec/fence/functions/status
new file mode 100755
index 0000000..03eaed2
--- /dev/null
+++ b/libexec/fence/functions/status
@@ -0,0 +1,14 @@
+#!/bin/sh -x
+
+set -e
+
+NAME="${@}"
+
+if sudo cnt list -f sh -s | grep -qs "^${NAME}"
+then
+ CNT_STATUS="started"
+else
+ CNT_STATUS="stopped"
+fi
+
+export CNT_STATUS=${CNT_STATUS}