summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2020-02-20 14:23:49 +0100
committerRamón M. Gómez <ramongomez@us.es>2020-02-20 14:23:49 +0100
commitba568ee49724fa3dddc77306f5d9179fd92d8fac (patch)
tree972f72251077d4a536a1d4128f9f5e36a5d791e3
parent814a7ba44b3c5d6877b3e8219b173b667d3f504d (diff)
#940: OGAgent user scripts looks for Python 2.
-rwxr-xr-xadmin/Sources/Clients/ogagent/linux/scripts/OGAgentTool8
1 files changed, 8 insertions, 0 deletions
diff --git a/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool b/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool
index 5b300523..50055428 100755
--- a/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool
+++ b/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool
@@ -1,5 +1,13 @@
#!/bin/sh
+for p in python python2; do
+ [ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 2 ] && PYTHON=$p
+done
+if [ -z "$PYTHON" ]; then
+ echo "ERROR: OGAgent needs Python 2" &>2
+ exit 1
+fi
+
FOLDER=/usr/share/OGAgent
cd $FOLDER