mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-19 04:05:36 +00:00
Fix image upgrade bug and add no-startup-command.
This commit is contained in:
+2
-1
@@ -17,7 +17,8 @@ if [[ "$#" -eq 0 ]];then
|
||||
fi
|
||||
|
||||
addSelfToNLB() {
|
||||
if ! ec2-metadata --user-data | grep "^image-upgrade$" ; then
|
||||
user_data=$(ec2-metadata --user-data | sed -e 's/^user-data: //')
|
||||
if ! echo "$user_data" | grep "^image-upgrade$" && ! echo "$user_data" | grep "^no-startup-automation$" ; then
|
||||
ec2-metadata --local-ipv4 | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>" > /var/cache/local-ip
|
||||
ec2-metadata --availability-zone | grep -o "[a-zA-Z]\+-[a-zA-Z]\+-[0-9a-z]\+\>" > /var/cache/availability-zone
|
||||
aws elbv2 register-targets --target-group-arn "${targetGroupArn}" --targets Id="${selfIp}",Port=80,AvailabilityZone="${availabilityZone}"
|
||||
|
||||
Reference in New Issue
Block a user