1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

double-double-quote vars in echo for safety etc

This commit is contained in:
holta 2019-10-24 21:44:07 -04:00 committed by Jerry Vonau
parent 38fd86ac90
commit ef0ab50bd7
2 changed files with 10 additions and 11 deletions

View file

@ -7,7 +7,7 @@ IIAB_STATE_FILE=/etc/iiab/iiab_state.yml
IIAB_ENV_FILE=/etc/iiab/iiab.env IIAB_ENV_FILE=/etc/iiab/iiab.env
if [ ! -f $PLAYBOOK ]; then if [ ! -f $PLAYBOOK ]; then
echo -e "\nExiting: IIAB Playbook $PLAYBOOK not found." echo -e "\nEXITING: IIAB Playbook ""$PLAYBOOK"" not found."
echo -e "\nPlease run this in /opt/iiab/iiab (top level of the git repo)." echo -e "\nPlease run this in /opt/iiab/iiab (top level of the git repo)."
exit 1 exit 1
fi fi
@ -18,13 +18,13 @@ if [ -f $IIAB_ENV_FILE ]; then
source /etc/iiab/iiab.env source /etc/iiab/iiab.env
echo -e "\nExtracted STAGE=$STAGE (counter) from /etc/iiab/iiab.env" echo -e "\nExtracted STAGE=$STAGE (counter) from /etc/iiab/iiab.env"
if ! [ "$STAGE" -eq "$STAGE" ] 2> /dev/null; then if ! [ "$STAGE" -eq "$STAGE" ] 2> /dev/null; then
echo -e "\nEXITING: STAGE (counter) value == $STAGE is non-integer" echo -e "\nEXITING: STAGE (counter) value == ""$STAGE"" is non-integer"
exit 1 exit 1
elif [ "$STAGE" -lt 0 ] || [ "$STAGE" -gt 9 ]; then elif [ "$STAGE" -lt 0 ] || [ "$STAGE" -gt 9 ]; then
echo -e "\nEXITING: STAGE (counter) value == $STAGE is out-of-range" echo -e "\nEXITING: STAGE (counter) value == ""$STAGE"" is out-of-range"
exit 1 exit 1
elif [ "$STAGE" -lt 3 ]; then elif [ "$STAGE" -lt 3 ]; then
echo -e "\nEXITING: STAGE (counter) value == $STAGE" echo -e "\nEXITING: STAGE (counter) value == ""$STAGE"
echo -e "\nIIAB Stage 3 not complete." echo -e "\nIIAB Stage 3 not complete."
echo -e "\nPlease run: ./iiab-install" echo -e "\nPlease run: ./iiab-install"
exit 1 exit 1
@ -43,11 +43,9 @@ else
fi fi
# Workaround for (web-published) images; will go away later # Workaround for (web-published) images; will go away later
if grep -q sugar $IIAB_STATE_FILE; then if grep -q sugar $IIAB_STATE_FILE; && ! grep -q mongodb $IIAB_STATE_FILE; then
if ! grep -q mongodb $IIAB_STATE_FILE; then
echo "mongodb_installed: True" >> $IIAB_STATE_FILE echo "mongodb_installed: True" >> $IIAB_STATE_FILE
fi fi
fi
export ANSIBLE_LOG_PATH="$CWD/iiab-configure.log" export ANSIBLE_LOG_PATH="$CWD/iiab-configure.log"
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local

View file

@ -31,7 +31,7 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then
echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2
echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2
echo -e ' http://download.iiab.io (click on "7.0" or a more recent version!)\n' >&2 echo -e ' http://download.iiab.io\n' >&2
exit 1 exit 1
fi fi
@ -47,8 +47,8 @@ cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact
echo "Placed /etc/ansible/facts.d/local_facts.fact into position." echo "Placed /etc/ansible/facts.d/local_facts.fact into position."
if [ ! -f $PLAYBOOK ]; then if [ ! -f $PLAYBOOK ]; then
echo "EXITING: IIAB Playbook not found." echo "EXITING: IIAB Playbook ""$PLAYBOOK"" not found."
echo "Please run 'iiab-install' from /opt/iiab/iiab (top level of git repo)." echo "Please run './iiab-install' from /opt/iiab/iiab (top level of git repo)."
exit 1 exit 1
fi fi
@ -152,6 +152,7 @@ fi
# Assumes /etc/iiab/iiab_state.yml is not created until (prior run of) Stage 4. # Assumes /etc/iiab/iiab_state.yml is not created until (prior run of) Stage 4.
if [ -f $IIAB_STATE_FILE ]; then if [ -f $IIAB_STATE_FILE ]; then
# Workaround for (web-published) images; will go away later
if grep -q sugar $IIAB_STATE_FILE; && ! grep -q mongodb $IIAB_STATE_FILE; then if grep -q sugar $IIAB_STATE_FILE; && ! grep -q mongodb $IIAB_STATE_FILE; then
echo "mongodb_installed: True" >> $IIAB_STATE_FILE echo "mongodb_installed: True" >> $IIAB_STATE_FILE
fi fi