Skip to content
Snippets Groups Projects
Commit f602fec4 authored by Václav Bartoš's avatar Václav Bartoš
Browse files

configure.sh: Fixed typos, whitespaces and other minor errors

parent 7f7e0c6e
No related branches found
No related tags found
No related merge requests found
......@@ -5,9 +5,9 @@ clear
wait () {
secs=${1}
while [ $secs -gt 0 ]; do
echo -ne "$secs\033[0K\r"
sleep 1
: $((secs--))
echo -ne "$secs\033[0K\r"
sleep 1
: $((secs--))
done
}
......@@ -19,7 +19,7 @@ MODIFY=${MODIFY:-no}
case $MODIFY in
yes|Yes|YES )
echo modify
echo "please enter(command) which editor you want to use for editing this file"
echo "Please enter which editor (command) you want to use for editing this file"
read -p "[vi] : " EDITOR
EDITOR=${EDITOR:-vi}
if [[ ( $EDITOR = "vi" ) || $EDITOR = "vim" ]]; then
......@@ -27,14 +27,14 @@ case $MODIFY in
echo "Instruction: "
echo -e "\t 1. press i to edit file"
echo -e "\t 2. modify file based on your needs"
echo -e "\t 3. to save changes use followng sequence: 'Esc : wq' and press enter"
echo "to discurd changes, use: 'Esc : q!' and press enter"
echo -e "\t 3. to save changes use following sequence: 'Esc : wq' and press enter"
echo "to discard changes, use: 'Esc : q!' and press enter"
read -p "press enter to continue ..." CONTINUE
$EDITOR access.ips
else
echo "$EDITOR not found. install it and start over"
exit 1
fi
exit 1
fi
else
if `which $EDITOR > /dev/null 2>&1`; then
$EDITOR access.ips
......@@ -48,34 +48,38 @@ case $MODIFY in
echo no
;;
* )
echo "Unknown answer, not modifing access rules!"
echo "Unknown answer, not modifying access rules!"
;;
esac
./generate_haproxy_whitelis_files.sh
./generate_haproxy_whitelist_files.sh
if [ $? -gt 0 ]; then
echo "error occured, please check access.ips file structure. lines starting with '###' should not be modified"
echo "Error occurred, please check access.ips file structure. lines starting with '###' should not be modified"
exit 1
else
echo "access restrictions configured successfully"
echo "Access restrictions configured successfully"
echo ""
fi
if [ -f group_vars/all/variables.yml ]; then
echo "Variables file (group_vars/all/variables.yml) is configure manually. please take a look if everything is correct and move to next step"
echo "Variables file (group_vars/all/variables.yml) is already configured manually. Please take a look if everything is correct and move to the next step"
echo
echo "group_vars/all/variables.yml:"
echo "============================================================"
cat group_vars/all/variables.yml
else
echo "set FQDN which will be used to access the soctools services. (the DNS record should already be in place.)"
echo "============================================================"
else
echo "Set the FQDN which will be used to access the soctools services (the DNS record should already be in place)"
read -p "[$(hostname -f)]: " soctoolsproxy
soctoolsproxy=${soctoolsproxy:-$(hostname -f)}
echo
echo "Organization's top level domain (will be used as organization name and organization domain in different services)"
read -p 'domain: ' domain
if [ -z $domain ]; then
echo "Error: Empty string for domain! exiting..."
exit 1
fi
if [ -z $domain ]; then
echo "Error: Empty string for domain! exiting..."
exit 1
fi
echo
echo
echo
......@@ -101,18 +105,18 @@ else
echo
echo
echo
echo "Please check the gethered variables and type 'yes' if everything is correct: "
echo "soctoolsproxy: $soctoolsproxy"
echo "domain: $domain"
echo "firstname: $firstname"
echo "lastname: $lastname"
echo "username: $username"
echo "DN: $DN"
echo "CN: $CN"
echo "Please check the gathered variables and type 'yes' if everything is correct:"
echo "soctoolsproxy: $soctoolsproxy"
echo "domain: $domain"
echo "firstname: $firstname"
echo "lastname: $lastname"
echo "username: $username"
echo "DN: $DN"
echo "CN: $CN"
echo
echo
read -p "Correct? type 'yes' or 'no': " ANSWER
if [ $ANSWER = "yes" ]; then
if [ "$ANSWER" = "yes" ]; then
if ! [ -f group_vars/all/variables.template ]; then
echo "template file(group_vars/all/variables.template) does not exists! exiting ..."
exit 1
......@@ -130,7 +134,7 @@ else
echo
echo
echo "variables file generated (group_vars/all/variables.yml)"
echo "We have configured for you following config files: access.ips, group_vars/all/variables.yml and we have also generated HAProxy Access Control Lists in the following directory: roles/haproxy/files"
echo "We have configured for you the following config files: access.ips, group_vars/all/variables.yml and we have also generated HAProxy Access Control Lists in the following directory: roles/haproxy/files"
echo ""
echo "move to next command to deploy the soctools cluster."
echo 'Thank You!'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment