* usr/lib/byobu/ec2_cost, usr/lib/byobu/hostname,

usr/lib/byobu/ip_address:
  - use wget instead of host to check for metadata
This commit is contained in:
Dustin Kirkland 2011-06-27 04:39:10 -04:00
commit ce970ecd23
4 changed files with 6 additions and 3 deletions

3
debian/changelog vendored
View file

@ -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 <kirkland@ubuntu.com> Thu, 16 Jun 2011 16:16:29 -0500

View file

@ -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")

View file

@ -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

View file

@ -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