Consistency cleanups

This commit is contained in:
Daniel Goldberg 2020-02-03 08:43:35 +02:00
parent b420a83e22
commit 5002a7c173
1 changed files with 8 additions and 11 deletions

View File

@ -24,7 +24,7 @@ log_message() {
} }
config_branch=${2:-"develop"} config_branch=${2:-"develop"}
config_url="https://raw.githubusercontent.com/guardicore/monkey/"$config_branch"/deployment_scripts/config" config_url="https://raw.githubusercontent.com/guardicore/monkey/${config_branch}/deployment_scripts/config"
if exists curl; then if exists curl; then
file=$(mktemp) file=$(mktemp)
@ -46,14 +46,11 @@ fi
# We can set main paths after we know the home dir # We can set main paths after we know the home dir
ISLAND_PATH="$monkey_home/monkey/monkey_island" ISLAND_PATH="$monkey_home/monkey/monkey_island"
MONKEY_COMMON_PATH="$monkey_home/monkey/common/"
MONGO_PATH="$ISLAND_PATH/bin/mongodb" MONGO_PATH="$ISLAND_PATH/bin/mongodb"
ISLAND_BINARIES_PATH="$ISLAND_PATH/cc/binaries" ISLAND_BINARIES_PATH="$ISLAND_PATH/cc/binaries"
INFECTION_MONKEY_DIR="$monkey_home/monkey/infection_monkey" INFECTION_MONKEY_DIR="$monkey_home/monkey/infection_monkey"
MONKEY_BIN_DIR="$INFECTION_MONKEY_DIR/bin" MONKEY_BIN_DIR="$INFECTION_MONKEY_DIR/bin"
if is_root; then if is_root; then
echo "Please don't run this script as root" echo "Please don't run this script as root"
exit 1 exit 1
@ -118,14 +115,14 @@ sudo apt-get update
log_message "Install python3.7-dev" log_message "Install python3.7-dev"
sudo apt-get install python3.7-dev sudo apt-get install python3.7-dev
log_message "Installing island requirements" log_message "Installing island requirements_island"
requirements="$ISLAND_PATH/requirements.txt" requirements_island="$ISLAND_PATH/requirements.txt"
${python_cmd} -m pip install --user --upgrade -r ${requirements} || handle_error ${python_cmd} -m pip install -r "${requirements_island}" --user --upgrade || handle_error
log_message "Installing monkey requirements" log_message "Installing monkey requirements_island"
sudo apt-get install libffi-dev upx libssl-dev libc++1 sudo apt-get install libffi-dev upx libssl-dev libc++1
cd "${monkey_home}"/monkey/infection_monkey || handle_error requirements_monkey="$INFECTION_MONKEY_DIR/requirements.txt"
${python_cmd} -m pip install -r requirements.txt --user --upgrade || handle_error ${python_cmd} -m pip install -r "${requirements_monkey}" --user --upgrade || handle_error
# Download binaries # Download binaries
log_message "Downloading binaries" log_message "Downloading binaries"
@ -183,7 +180,7 @@ log_message "Downloading traceroute binaries"
wget -c -N -P "${MONKEY_BIN_DIR}" "${TRACEROUTE_64_BINARY_URL}" wget -c -N -P "${MONKEY_BIN_DIR}" "${TRACEROUTE_64_BINARY_URL}"
wget -c -N -P "${MONKEY_BIN_DIR}" "${TRACEROUTE_32_BINARY_URL}" wget -c -N -P "${MONKEY_BIN_DIR}" "${TRACEROUTE_32_BINARY_URL}"
sudo chmod +x "${monkey_home}"/monkey/infection_monkey/build_linux.sh sudo chmod +x "${INFECTION_MONKEY_DIR}/build_linux.sh"
log_message "Deployment script finished." log_message "Deployment script finished."
exit 0 exit 0