openflighthpc / flight-desktop

Manage interactive GUI desktop sessions
Eclipse Public License 2.0
0 stars 2 forks source link

Desktops fail to start on AWS if instance has no public IP #23

Closed mjtko closed 4 years ago

mjtko commented 4 years ago

The script responsible for determining the public IP of the node assumes that if a node is detected as running on EC2, it's got a public IP. That assumption isn't necessarily correct!

This change helps make it work again:

if network_is_ec2; then
  ip=$(curl -fs http://169.254.169.254/latest/meta-data/public-ipv4 2>/dev/null)
  if [ $? -gt 0 ]; then
    curl -fs http://169.254.169.254/latest/meta-data/local-ipv4
  else
    echo "$ip"
  fi