<commit_before>#!/bin/bash

# Arguments check
if [ $# -ne 3 ]; then
	echo "Not enough arguments:"
	echo "Usage: main [node_num] [node_ip] [cluster_ips] (formatted: 1.1.1.1,2.2.2.2,3.3.3.3)"
	exit
fi

# Interupter check
[[ $_ != $0 ]] && sourced=1 || sourced=0
if [ $sourced -ne 1 ]; then
	echo "Please use 'bash main.sh to run the script"
	exit;
fi

# Root check
if [[ $EUID -ne 0 ]]; then
	echo "Please run script as root"
	exit;
fi

# Run scripts
sudo bash ./src/install_mariadb_galera_cluster_base.sh $1 $2 
sudo bash ./src/update_galera_config.sh $3 
read -r -p "Setting up main node? [Y/n] " response
case "$response" in 
	[yY][eE][sS]|[yY])
		sudo bash ./src/start_galera_cluster.sh
		;;
	*)
		sudo bash ./src/start_galera_node.sh
		;;
esac
sudo bash ./src/show_galera_status.sh

echo "Installation complete. Galera is now running on this machine"
echo "Signing into account..."

sudo su - $user<commit_msg>added add_workbench_support to install.sh<commit_after>#!/bin/bash

# Arguments check
if [ $# -ne 3 ]; then
	echo "Not enough arguments:"
	echo "Usage: main [node_num] [node_ip] [cluster_ips] (formatted: 1.1.1.1,2.2.2.2,3.3.3.3)"
	exit
fi

# Interupter check
[[ $_ != $0 ]] && sourced=1 || sourced=0
if [ $sourced -ne 1 ]; then
	echo "Please use 'bash main.sh to run the script"
	exit;
fi

# Root check
if [[ $EUID -ne 0 ]]; then
	echo "Please run script as root"
	exit;
fi

# Run scripts
sudo bash ./src/install_mariadb_galera_cluster_base.sh $1 $2 
read -r -p "Would you like to add support for MySQL Workbench? [Y/n] " response
case "$response" in 
	[yY][eE][sS]|[yY])
		sudo bash ./src/add_workbench_support.sh
		;;
	*)
		;;
esac
sudo bash ./src/update_galera_config.sh $3 
read -r -p "Setting up main node? [Y/n] " response
case "$response" in 
	[yY][eE][sS]|[yY])
		sudo bash ./src/enable_node_bootstrapping
		sudo bash ./src/start_galera_cluster.sh
		;;
	*)
		sudo bash ./src/start_galera_node.sh
		;;
esac
sudo bash ./src/show_galera_status.sh

echo "Installation complete. Galera is now running on this machine"
echo "Signing into account..."

sudo su - $user
{'fraction_non_alphanumeric': 0.14848630466122056, 'fraction_numerical': 0.020182604517059107, 'mean_word_length': 3.6164079822616406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5466203', 'n_tokens_mistral': 880, 'n_tokens_neox': 817, 'n_words': 243}