Modify monkey_island/linux/run.sh to use pipenv

This commit is contained in:
Mike Salvatore 2021-04-19 19:37:46 -04:00
parent de8e306786
commit 051621bdfa
2 changed files with 20 additions and 15 deletions

View File

@ -60,8 +60,8 @@ You may also pass in an optional third `false` parameter to disable downloading
After the `deploy_linux.sh` script completes, you can start the monkey island.
```sh
cd infection_monkey/monkey
./monkey_island/linux/run.sh
cd infection_monkey/monkey/monkey_island
pipenv run ./linux/run.sh
```
## Pre-commit hooks

View File

@ -1,16 +1,21 @@
#!/bin/bash
# Detecting command that calls python 3.7
python_cmd=""
if [[ $(python --version 2>&1) == *"Python 3.7"* ]]; then
python_cmd="python"
fi
if [[ $(python37 --version 2>&1) == *"Python 3.7"* ]]; then
python_cmd="python37"
fi
if [[ $(python3.7 --version 2>&1) == *"Python 3.7"* ]]; then
python_cmd="python3.7"
fi
start_mongo() {
# TODO: Handle starting and cleaning up mongo inside monkey_island.py or
# monkey_island/main.py.
./bin/mongodb/bin/mongod --dbpath ./bin/mongodb/db &
}
./monkey_island/bin/mongodb/bin/mongod --dbpath ./monkey_island/bin/mongodb/db &
${python_cmd} ./monkey_island.py
cd_to_monkey() {
# Pipenv must be run from monkey/monkey/monkey_island, but monkey_island.py
# must be executed from monkey/monkey.
cd ..
}
start_monkey_island() {
cd_to_monkey
python ./monkey_island.py
}
start_mongo
start_monkey_island