FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Additional escaping of AWS CLI commands · Dilli-R/aws-codedeploy-samples@0715ee2 · GitHub

Commit 0715ee2

Browse files
Andy
committed
Additional escaping of AWS CLI commands
1 parent edd5f9a commit 0715ee2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎load-balancing/elb/common_functions.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ check_suspended_processes() {
141141
local suspended=($($AWS_CLI autoscaling describe-auto-scaling-groups \
142142
--auto-scaling-group-name \"${asg_name}\" \
143143
--query \'AutoScalingGroups[].SuspendedProcesses\' \
144-
--output text | awk \'{printf $1\" \"}\'))
144+
--output text \| awk \'{printf \$1\" \"}\'))
145145

146146
if [ ${#suspended[@]} -eq 0 ]; then
147147
msg "No processes were suspended on the ASG before starting."
@@ -596,8 +596,8 @@ get_elb_list() {
596596
local elb_list=""
597597

598598
elb_list=$($AWS_CLI elb describe-load-balancers \
599-
--query \"LoadBalancerDescriptions[].[join(',',Instances[?InstanceId=='$instance_id'].InstanceId),LoadBalancerName]\" \
600-
--output text | grep $instance_id | awk \'{ORS=\" \";print $2}\')
599+
--query \"LoadBalancerDescriptions[].[join\(\',\',Instances[?InstanceId==\'$instance_id\'].InstanceId\),LoadBalancerName]\" \
600+
--output text \| grep $instance_id \| awk \'{ORS=\" \"\;print \$2}\')
601601

602602
if [ -z "$elb_list" ]; then
603603
return 1
@@ -642,7 +642,7 @@ register_instance() {
642642
# $MIN_CLI_VERSION. Returns non-zero if the version is not high enough.
643643
check_cli_version() {
644644
if [ -z $1 ]; then
645-
version=$($AWS_CLI --version 2>&1 | cut -f1 -d' ' | cut -f2 -d/)
645+
version=$($AWS_CLI --version 2\>\&1 \| cut -f1 -d\' \' \| cut -f2 -d/)
646646
else
647647
version=$1
648648
fi

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL