From eeb5b08c98e1068869e97570500dce31eff69bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20M=2E=20G=C3=B3mez?= Date: Wed, 19 Feb 2020 13:49:46 +0100 Subject: [PATCH] #940: OGAgent control scripts looks for Python 2. --- linux/scripts/ogagent | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/linux/scripts/ogagent b/linux/scripts/ogagent index 1bcc29b..155af67 100755 --- a/linux/scripts/ogagent +++ b/linux/scripts/ogagent @@ -1,6 +1,14 @@ #!/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 -python -m opengnsys.linux.OGAgentService $@ +$PYTHON -m opengnsys.linux.OGAgentService $@