Skip to content

Commit

Permalink
Updated shell scripts based on reccomendations from shellcheck bash l…
Browse files Browse the repository at this point in the history
…inter.
  • Loading branch information
tassoskoutlas committed Apr 2, 2017
1 parent 6ff9f72 commit 11486e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions provision.sh
Expand Up @@ -5,11 +5,11 @@
export PYTHONUNBUFFERED=1

# Get server IP from config.yml
IP=`cat config.yml | grep -E '^server_ip:\s.*$' | cut -d" " -f2`
IP=$(grep -E '^server_ip:\s.*$' config.yml | cut -d" " -f2)

if [ -z "${IP}" ]; then
echo "Please specify IP address in config.yml"
exit
fi

ansible-playbook -vvvv -i $IP, services/jenkinsbox.yml --extra-vars "@config.yml"
ansible-playbook -vvvv -i "${IP}", services/jenkinsbox.yml --extra-vars "@config.yml"
4 changes: 2 additions & 2 deletions requirements.sh
Expand Up @@ -4,7 +4,7 @@
help="Visit http://docs.cibox.tools/en/latest/Requirements for more information."
ansible=$(which ansible)

if [ -z ${ansible} ]; then
if [ -z "${ansible}" ]; then
echo "Ansible not installed. Further interaction is not possible. ${help}"
exit 1
fi
Expand All @@ -17,7 +17,7 @@ ansible_version_required="1.9.4"
# Use the second column from first row.
ansible_version_current=$(${ansible} --version | head -1 | awk '{print $2}')

if ! echo ${ansible_version_current} | grep ${ansible_version_required} >/dev/null; then
if ! echo "${ansible_version_current}" | grep ${ansible_version_required} >/dev/null; then
echo "You have installed Ansible ${ansible_version_current}, but CIBox requires ${ansible_version_required}. ${help}"
exit 2
fi

0 comments on commit 11486e1

Please sign in to comment.