<commit_before>#!/bin/bash
# http://linux.about.com/od/Bash_Scripting_Solutions/a/How-To-Pass-Arguments-To-A-Bash-Script.htm
# http://stackoverflow.com/questions/169511/how-do-i-iterate-over-a-range-of-numbers-defined-by-variables-in-bash
# http://www.cyberciti.biz/faq/bash-for-loop/
# https://docs.vagrantup.com/v2/provisioning/shell.html
# http://www.cyberciti.biz/faq/bash-prepend-text-lines-to-file/
source "/vagrant/scripts/common.sh"
TOTAL_NODES=2

while getopts t: option
do
	case "${option}"
	in
		t) TOTAL_NODES=${OPTARG};;
	esac
done

function setupHosts {
	echo "modifying /etc/hosts file"
	for i in $(seq 1 $TOTAL_NODES)
	do 
		entry="10.211.55.10${i} node${i}"
		echo "adding ${entry}"
		echo "${entry}" >> /etc/nhosts
	done
	echo "127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4" >> /etc/nhosts
	echo "::1         localhost localhost.localdomain localhost6 localhost6.localdomain6" >> /etc/nhosts
	#cat /etc/hosts >> /etc/nhosts
	cp /etc/nhosts /etc/hosts
	rm -f /etc/nhosts
}


echo "setup centos hosts file"
setupHosts<commit_msg>fix hosts file<commit_after>#!/bin/bash
# http://linux.about.com/od/Bash_Scripting_Solutions/a/How-To-Pass-Arguments-To-A-Bash-Script.htm
# http://stackoverflow.com/questions/169511/how-do-i-iterate-over-a-range-of-numbers-defined-by-variables-in-bash
# http://www.cyberciti.biz/faq/bash-for-loop/
# https://docs.vagrantup.com/v2/provisioning/shell.html
# http://www.cyberciti.biz/faq/bash-prepend-text-lines-to-file/
source "/vagrant/scripts/common.sh"
TOTAL_NODES=2

while getopts t: option
do
	case "${option}"
	in
		t) TOTAL_NODES=${OPTARG};;
	esac
done

function setupHosts {
	echo "modifying /etc/hosts file"
	for i in $(seq 1 $TOTAL_NODES)
	do 
		entry="10.211.55.10${i} mesosnode${i}"
		echo "adding ${entry}"
		echo "${entry}" >> /etc/nhosts
	done
	echo "127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4" >> /etc/nhosts
	echo "::1         localhost localhost.localdomain localhost6 localhost6.localdomain6" >> /etc/nhosts
	#cat /etc/hosts >> /etc/nhosts
	cp /etc/nhosts /etc/hosts
	rm -f /etc/nhosts
}


echo "setup centos hosts file"
setupHosts
{'fraction_non_alphanumeric': 0.16096207215541167, 'fraction_numerical': 0.028677150786308975, 'mean_word_length': 3.972413793103448, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 4, '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': '3686950', 'n_tokens_mistral': 939, 'n_tokens_neox': 848, 'n_words': 145}