2018-12-10 19:08:59 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Absolute monkey's path
|
2020-04-17 06:04:40 +08:00
|
|
|
export MONKEY_FOLDER_NAME="infection_monkey"
|
2018-12-10 19:08:59 +08:00
|
|
|
# Url of public git repository that contains monkey's source code
|
2020-04-17 06:04:40 +08:00
|
|
|
export MONKEY_GIT_URL="https://github.com/guardicore/monkey"
|
|
|
|
|
|
|
|
get_latest_release() {
|
|
|
|
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub API
|
|
|
|
grep '"tag_name":' | # Get tag line
|
|
|
|
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
|
|
|
|
}
|
|
|
|
|
2020-10-05 15:24:37 +08:00
|
|
|
MONKEY_LATEST_RELEASE=$(get_latest_release "guardicore/monkey")
|
2018-12-10 19:08:59 +08:00
|
|
|
|
|
|
|
# Monkey binaries
|
2020-07-14 16:15:43 +08:00
|
|
|
LINUX_32_BINARY_NAME="monkey-linux-32"
|
2020-04-17 06:04:40 +08:00
|
|
|
LINUX_32_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/monkey-linux-32"
|
|
|
|
export LINUX_32_BINARY_URL
|
2020-07-14 16:15:43 +08:00
|
|
|
export LINUX_32_BINARY_NAME
|
|
|
|
|
|
|
|
LINUX_64_BINARY_NAME="monkey-linux-64"
|
2020-04-17 06:04:40 +08:00
|
|
|
LINUX_64_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/monkey-linux-64"
|
|
|
|
export LINUX_64_BINARY_URL
|
2020-07-14 16:15:43 +08:00
|
|
|
export LINUX_64_BINARY_NAME
|
|
|
|
|
|
|
|
WINDOWS_32_BINARY_NAME="monkey-windows-32.exe"
|
2020-04-17 06:04:40 +08:00
|
|
|
WINDOWS_32_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/monkey-windows-32.exe"
|
|
|
|
export WINDOWS_32_BINARY_URL
|
2020-07-14 16:15:43 +08:00
|
|
|
export WINDOWS_32_BINARY_NAME
|
|
|
|
|
|
|
|
WINDOWS_64_BINARY_NAME="monkey-windows-64.exe"
|
2020-04-17 06:04:40 +08:00
|
|
|
WINDOWS_64_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/monkey-windows-64.exe"
|
|
|
|
export WINDOWS_64_BINARY_URL
|
2020-07-14 16:15:43 +08:00
|
|
|
export WINDOWS_64_BINARY_NAME
|
2018-12-10 19:08:59 +08:00
|
|
|
|
2019-10-09 16:23:20 +08:00
|
|
|
# Other binaries for monkey
|
2020-04-17 06:04:40 +08:00
|
|
|
TRACEROUTE_64_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/traceroute64"
|
|
|
|
export TRACEROUTE_64_BINARY_URL
|
|
|
|
TRACEROUTE_32_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/traceroute32"
|
|
|
|
export TRACEROUTE_32_BINARY_URL
|
|
|
|
SAMBACRY_64_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/sc_monkey_runner64.so"
|
|
|
|
export SAMBACRY_64_BINARY_URL
|
|
|
|
SAMBACRY_32_BINARY_URL="https://github.com/guardicore/monkey/releases/download/$($MONKEY_LATEST_RELEASE)/sc_monkey_runner32.so"
|
|
|
|
export SAMBACRY_32_BINARY_URL
|