From 01a130273f433b6008611f69c3ff78b6a35ffe6b Mon Sep 17 00:00:00 2001 From: Abdelsalam Abbas Date: Sun, 20 Aug 2017 12:55:13 +0200 Subject: [PATCH] fix issues with if condition (#1537) --- contrib/azurerm/apply-rg.sh | 4 ++-- contrib/azurerm/clear-rg.sh | 2 +- contrib/azurerm/generate-inventory.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/azurerm/apply-rg.sh b/contrib/azurerm/apply-rg.sh index 635d166bb..efa330bb5 100755 --- a/contrib/azurerm/apply-rg.sh +++ b/contrib/azurerm/apply-rg.sh @@ -9,10 +9,10 @@ if [ "$AZURE_RESOURCE_GROUP" == "" ]; then exit 1 fi -if [ $(az &>/dev/null) ] ; then +if az &>/dev/null; then echo "azure cli 2.0 found, using it instead of 1.0" ./apply-rg_2.sh "$AZURE_RESOURCE_GROUP" -elif [ $(azure &>/dev/null) ] ; then +elif azure &>/dev/null; then ansible-playbook generate-templates.yml azure group deployment create -f ./.generated/network.json -g $AZURE_RESOURCE_GROUP diff --git a/contrib/azurerm/clear-rg.sh b/contrib/azurerm/clear-rg.sh index f2537cca0..64fea1f16 100755 --- a/contrib/azurerm/clear-rg.sh +++ b/contrib/azurerm/clear-rg.sh @@ -9,7 +9,7 @@ if [ "$AZURE_RESOURCE_GROUP" == "" ]; then exit 1 fi -if [ $(az &>/dev/null) ] ; then +if az &>/dev/null; then echo "azure cli 2.0 found, using it instead of 1.0" ./clear-rg_2.sh "$AZURE_RESOURCE_GROUP" else diff --git a/contrib/azurerm/generate-inventory.sh b/contrib/azurerm/generate-inventory.sh index 0642e5d6d..b3eb9c0fe 100755 --- a/contrib/azurerm/generate-inventory.sh +++ b/contrib/azurerm/generate-inventory.sh @@ -9,9 +9,9 @@ if [ "$AZURE_RESOURCE_GROUP" == "" ]; then exit 1 fi # check if azure cli 2.0 exists else use azure cli 1.0 -if [ $(az &>/dev/null) ] ; then +if az &>/dev/null; then ansible-playbook generate-inventory_2.yml -e azure_resource_group="$AZURE_RESOURCE_GROUP" -elif [ $(azure &>/dev/null) ]; then +elif azure &>/dev/null; then ansible-playbook generate-inventory.yml -e azure_resource_group="$AZURE_RESOURCE_GROUP" else echo "Azure cli not found"