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