diff --git a/debian/changelog b/debian/changelog index 362705af..a273ef2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ byobu (4.14) unreleased; urgency=low * usr/share/byobu/profiles/tmux: - getting tmux keybindings much closer! + * usr/lib/byobu/ec2_cost, usr/lib/byobu/hostname, + usr/lib/byobu/ip_address: + - use wget instead of host to check for metadata -- Dustin Kirkland Thu, 16 Jun 2011 16:16:29 -0500 diff --git a/usr/lib/byobu/ec2_cost b/usr/lib/byobu/ec2_cost index a396bf9a..c01e76e8 100755 --- a/usr/lib/byobu/ec2_cost +++ b/usr/lib/byobu/ec2_cost @@ -32,7 +32,7 @@ for arg in $@; do done # Try to use metadata service -if host 169.254.169.254 >/dev/null 2>&1; then +if wget -q -O- --timeout=1 http://169.254.169.254 >/dev/null 2>&1; then zone=$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone) . "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}" type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | sed -e "s/\./_/g") diff --git a/usr/lib/byobu/hostname b/usr/lib/byobu/hostname index 4460c206..8fa33321 100755 --- a/usr/lib/byobu/hostname +++ b/usr/lib/byobu/hostname @@ -26,7 +26,7 @@ if [ "$1" = "--detail" ]; then exit 0 fi -if host 169.254.169.254 >/dev/null 2>&1; then +if wget -q -O- --timeout=1 http://169.254.169.254 2>&1; then # We're in EC2, so get our public hostname h=$(wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname) else diff --git a/usr/lib/byobu/ip_address b/usr/lib/byobu/ip_address index c06b4703..ed5c6df5 100755 --- a/usr/lib/byobu/ip_address +++ b/usr/lib/byobu/ip_address @@ -51,7 +51,7 @@ case "$IPV6" in ipaddr=${ipaddr%%/*} ;; *) - if host 169.254.169.254 >/dev/null 2>&1; then + if wget -q -O- --timeout=1 http://169.254.169.254 >/dev/null 2>&1; then # We're in EC2, so get our public IP address ipaddr=$(wget -q -O- http://169.254.169.254/latest/meta-data/public-ipv4) else