forked from p34709852/monkey
Minimize log messages.
This commit is contained in:
parent
1c4c22d8e9
commit
291ce9a199
|
@ -13,13 +13,25 @@ has_sudo() {
|
||||||
timeout 1 sudo id && return 0 || return 1
|
timeout 1 sudo id && return 0 || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_error() {
|
||||||
|
echo "Fix the errors above and rerun the script"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
log_message() {
|
||||||
|
echo -e "\n\n"
|
||||||
|
echo -e "DEPLOYMENT SCRIPT: $1"
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
||||||
curl -s -o $file "$config_url"
|
curl -s -o $file "$config_url"
|
||||||
|
log_message "downloaded configuration"
|
||||||
source $file
|
source $file
|
||||||
|
log_message "loaded configuration"
|
||||||
rm $file
|
rm $file
|
||||||
else
|
else
|
||||||
echo 'Your system does not have curl, exiting'
|
echo 'Your system does not have curl, exiting'
|
||||||
|
@ -40,16 +52,7 @@ 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"
|
||||||
|
|
||||||
handle_error() {
|
|
||||||
echo "Fix the errors above and rerun the script"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
log_message() {
|
|
||||||
echo -e "\n\n-------------------------------------------"
|
|
||||||
echo -e "DEPLOYMENT SCRIPT: $1"
|
|
||||||
echo -e "-------------------------------------------\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
if is_root; then
|
if is_root; then
|
||||||
echo "Please don't runt this script as root"
|
echo "Please don't runt this script as root"
|
||||||
|
|
Loading…
Reference in New Issue