* usr/bin/byobu-janitor, usr/lib/byobu/.shutil:

- get ec2 cost automatically working again in ec2 instances
This commit is contained in:
Dustin Kirkland 2011-08-01 23:44:06 -05:00
commit 2fa9ed3401
3 changed files with 7 additions and 2 deletions

3
debian/changelog vendored
View file

@ -1,6 +1,7 @@
byobu (4.24) unreleased; urgency=low byobu (4.24) unreleased; urgency=low
* UNRELEASED * usr/bin/byobu-janitor, usr/lib/byobu/.shutil:
- get ec2 cost automatically working again in ec2 instances
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 28 Jul 2011 01:17:54 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Thu, 28 Jul 2011 01:17:54 -0500

View file

@ -58,6 +58,10 @@ for f in status statusrc; do
if [ ! -r "$BYOBU_CONFIG_DIR/$f" ]; then if [ ! -r "$BYOBU_CONFIG_DIR/$f" ]; then
# Copy from skeleton, if possible # Copy from skeleton, if possible
[ -r "/etc/$PKG/$f" ] && cp -f /etc/$PKG/$f "$BYOBU_CONFIG_DIR/$f" [ -r "/etc/$PKG/$f" ] && cp -f /etc/$PKG/$f "$BYOBU_CONFIG_DIR/$f"
if [ "$f" = "status" ] && metadata_available; then
# Enable ec2_cost if we're in ec2
$SED -i -e "s/ec2_cost=.*/ec2_cost=1/" "$BYOBU_CONFIG_DIR/$f"
fi
fi fi
done done

View file

@ -198,7 +198,7 @@ metadata_available() {
# This is really ugly. We need a reliable, fast way of determining # This is really ugly. We need a reliable, fast way of determining
# if a metadata service is available, that does NOT slow down non-ec2 # if a metadata service is available, that does NOT slow down non-ec2
# machines. # machines.
if [ -e /etc/ec2_version ]; then if [ -e /etc/ec2_version ] || [ -e /usr/sbin/update-grub-legacy-ec2 ]; then
wget -q -O- --timeout=1 http://169.254.169.254 >/dev/null 2>&1 wget -q -O- --timeout=1 http://169.254.169.254 >/dev/null 2>&1
else else
false false