forked from p15670423/monkey
Merge pull request #532 from guardicore/bugfix/update_deb_postinst_to_py3
Update debian installation to use python3
This commit is contained in:
commit
749bf4aeb5
|
@ -5,4 +5,4 @@ Homepage: http://www.guardicore.com
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Version: 1.0
|
Version: 1.0
|
||||||
Description: Guardicore Infection Monkey Island installation package
|
Description: Guardicore Infection Monkey Island installation package
|
||||||
Depends: openssl, python-pip, python-dev
|
Depends: openssl, python3-pip, python3-dev
|
||||||
|
|
|
@ -5,8 +5,8 @@ INSTALLATION_FOLDER=/var/monkey/monkey_island/installation
|
||||||
PYTHON_FOLDER=/var/monkey/monkey_island/bin/python
|
PYTHON_FOLDER=/var/monkey/monkey_island/bin/python
|
||||||
|
|
||||||
# Prepare python virtualenv
|
# Prepare python virtualenv
|
||||||
pip2 install virtualenv --no-index --find-links file://$INSTALLATION_FOLDER
|
pip3 install virtualenv --no-index --find-links file://$INSTALLATION_FOLDER
|
||||||
virtualenv -p python2.7 ${PYTHON_FOLDER}
|
virtualenv -p python3 ${PYTHON_FOLDER}
|
||||||
|
|
||||||
# install pip requirements
|
# install pip requirements
|
||||||
${PYTHON_FOLDER}/bin/python -m pip install -r $MONKEY_FOLDER/monkey_island/requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER
|
${PYTHON_FOLDER}/bin/python -m pip install -r $MONKEY_FOLDER/monkey_island/requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER
|
||||||
|
|
|
@ -5,8 +5,8 @@ INSTALLATION_FOLDER=/var/monkey/monkey_island/installation
|
||||||
PYTHON_FOLDER=/var/monkey/monkey_island/bin/python
|
PYTHON_FOLDER=/var/monkey/monkey_island/bin/python
|
||||||
|
|
||||||
# Prepare python virtualenv
|
# Prepare python virtualenv
|
||||||
pip2 install virtualenv --no-index --find-links file://$INSTALLATION_FOLDER
|
pip3 install virtualenv --no-index --find-links file://$INSTALLATION_FOLDER
|
||||||
virtualenv -p python2.7 ${PYTHON_FOLDER}
|
virtualenv -p python3 ${PYTHON_FOLDER}
|
||||||
|
|
||||||
# install pip requirements
|
# install pip requirements
|
||||||
${PYTHON_FOLDER}/bin/python -m pip install -r $MONKEY_FOLDER/monkey_island/requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER
|
${PYTHON_FOLDER}/bin/python -m pip install -r $MONKEY_FOLDER/monkey_island/requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
MACHINE_TYPE=`uname -m`
|
MACHINE_TYPE=$(uname -m)
|
||||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
if [ "${MACHINE_TYPE}" == 'x86_64' ]; then
|
||||||
# 64-bit stuff here
|
# 64-bit stuff here
|
||||||
ARCH=64
|
ARCH=64
|
||||||
else
|
else
|
||||||
|
@ -11,4 +11,4 @@ fi
|
||||||
|
|
||||||
MONKEY_FILE=monkey-linux-$ARCH
|
MONKEY_FILE=monkey-linux-$ARCH
|
||||||
cp -f /var/monkey/monkey_island/cc/binaries/$MONKEY_FILE /tmp
|
cp -f /var/monkey/monkey_island/cc/binaries/$MONKEY_FILE /tmp
|
||||||
/tmp/$MONKEY_FILE m0nk3y $@
|
/tmp/$MONKEY_FILE m0nk3y "$@"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
MACHINE_TYPE=`uname -m`
|
MACHINE_TYPE=$(uname -m)
|
||||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
if [ "${MACHINE_TYPE}" == 'x86_64' ]; then
|
||||||
# 64-bit stuff here
|
# 64-bit stuff here
|
||||||
ARCH=64
|
ARCH=64
|
||||||
else
|
else
|
||||||
|
@ -11,4 +11,4 @@ fi
|
||||||
|
|
||||||
MONKEY_FILE=monkey-linux-$ARCH
|
MONKEY_FILE=monkey-linux-$ARCH
|
||||||
cp -f /var/monkey/monkey_island/cc/binaries/$MONKEY_FILE /tmp
|
cp -f /var/monkey/monkey_island/cc/binaries/$MONKEY_FILE /tmp
|
||||||
/tmp/$MONKEY_FILE m0nk3y $@
|
/tmp/$MONKEY_FILE m0nk3y "$@"
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
# Detecting command that calls python 3.7
|
# Detecting command that calls python 3.7
|
||||||
python_cmd=""
|
python_cmd=""
|
||||||
if [[ `python --version 2>&1` == *"Python 3.7"* ]]; then
|
if [[ $(python --version 2>&1) == *"Python 3.7"* ]]; then
|
||||||
python_cmd="python"
|
python_cmd="python"
|
||||||
fi
|
fi
|
||||||
if [[ `python37 --version 2>&1` == *"Python 3.7"* ]]; then
|
if [[ $(python37 --version 2>&1) == *"Python 3.7"* ]]; then
|
||||||
python_cmd="python37"
|
python_cmd="python37"
|
||||||
fi
|
fi
|
||||||
if [[ `python3.7 --version 2>&1` == *"Python 3.7"* ]]; then
|
if [[ $(python3.7 --version 2>&1) == *"Python 3.7"* ]]; then
|
||||||
python_cmd="python3.7"
|
python_cmd="python3.7"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue