-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from aws-deepracer-community/bash-lint
Bash Scripts Linted
- Loading branch information
Showing
22 changed files
with
727 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
## What am I? | ||
if [[ -f /var/run/cloud-init/instance-data.json ]]; | ||
then | ||
if [[ -f /var/run/cloud-init/instance-data.json ]]; then | ||
# We have a cloud-init environment (Azure or AWS). | ||
CLOUD_NAME=$(jq -r '.v1."cloud-name"' /var/run/cloud-init/instance-data.json) | ||
if [[ "${CLOUD_NAME}" == "azure" ]]; | ||
then | ||
if [[ "${CLOUD_NAME}" == "azure" ]]; then | ||
export CLOUD_NAME | ||
export CLOUD_INSTANCETYPE=$(jq -r '.ds."meta_data".imds.compute."vmSize"' /var/run/cloud-init/instance-data.json) | ||
elif [[ "${CLOUD_NAME}" == "aws" ]]; | ||
then | ||
elif [[ "${CLOUD_NAME}" == "aws" ]]; then | ||
export CLOUD_NAME | ||
export CLOUD_INSTANCETYPE=$(jq -r '.ds."meta-data"."instance-type"' /var/run/cloud-init/instance-data.json) | ||
else | ||
export CLOUD_NAME=local | ||
fi | ||
else | ||
export CLOUD_NAME=local | ||
fi | ||
fi |
Oops, something went wrong.