mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
* usr/bin/byobu-launch, usr/lib/byobu/ec2_cost,
usr/lib/byobu/hostname, usr/lib/byobu/include/shutil, usr/lib/byobu/ip_address: LP: #1208853 - revert this recent commit, as it appears to have some unintended consequences, and it was just cleaning up some false positive bashism hits
This commit is contained in:
parent
952b27de94
commit
7d22b869e5
6 changed files with 18 additions and 14 deletions
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -1,6 +1,11 @@
|
|||
byobu (5.53) unreleased; urgency=low
|
||||
|
||||
* UNRELEASED
|
||||
* usr/bin/byobu-launch, usr/lib/byobu/ec2_cost,
|
||||
usr/lib/byobu/hostname, usr/lib/byobu/include/shutil,
|
||||
usr/lib/byobu/ip_address: LP: #1208853
|
||||
- revert this recent commit, as it appears to have some unintended
|
||||
consequences, and it was just cleaning up some false positive
|
||||
bashism hits
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 05 Aug 2013 09:23:03 +0100
|
||||
|
||||
|
|
|
@ -63,8 +63,7 @@ elif [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_
|
|||
[ -z "$_byobu_sourced" ] && [ -r "$HOME/.profile" ] && . "$HOME/.profile"
|
||||
if byobu-launcher; then
|
||||
# Wait very briefly for the no-logout flag to get written?
|
||||
local brief="0.1"
|
||||
sleep $brief
|
||||
sleep 0.1
|
||||
if [ -e "$BYOBU_CONFIG_DIR/no-logout-on-detach" ] || [ -e "$BYOBU_RUN_DIR/no-logout" ]; then
|
||||
# The user does not want to logout on byobu detach
|
||||
rm -f "$BYOBU_RUN_DIR/no-logout" # Remove one-time no-logout flag, if it exists
|
||||
|
|
|
@ -32,17 +32,17 @@ __ec2_cost_detail() {
|
|||
}
|
||||
|
||||
__ec2_cost() {
|
||||
local zone type file_to_stat cpu mem rate hours tx_gb rx_gb network_cost uptime_cost total_cost interface cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/ec2_cost" brief="0.02"
|
||||
local zone type file_to_stat cpu mem rate hours tx_gb rx_gb network_cost uptime_cost total_cost interface cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/ec2_cost"
|
||||
if [ -s "$cache.rate" ]; then
|
||||
read rate < "$cache.rate"
|
||||
elif metadata_available; then
|
||||
# Try to use metadata service
|
||||
[ -s "$cache.zone" ] || wget -q -O- http://169.254.169.254/latest/meta-data/placement/availability-zone </dev/null >"$cache.zone" 2>/dev/null &
|
||||
sleep $brief
|
||||
sleep 0.02
|
||||
[ -s "$cache.zone" ] && read zone < "$cache.zone"
|
||||
zone=${zone%%[a-z]}
|
||||
[ -s "$cache.type" ] || wget -q -O- http://169.254.169.254/latest/meta-data/instance-type </dev/null >"$cache.type" 2>/dev/null &
|
||||
sleep $brief
|
||||
sleep 0.02
|
||||
[ -s "$cache.type" ] && read type < "$cache.type"
|
||||
$BYOBU_PREFIX/lib/byobu/include/ec2instancespricing.py --type ondemand --filter-region $zone --filter-type $type --filter-os-type linux --format csv | tail -n1 > "$cache.rate"
|
||||
read rate < "$cache.rate"
|
||||
|
|
|
@ -24,12 +24,12 @@ __hostname_detail() {
|
|||
}
|
||||
|
||||
__hostname() {
|
||||
local h= brief="0.02"
|
||||
local h=
|
||||
if metadata_available; then
|
||||
local cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/hostname"
|
||||
# Background a retrieval of our public hostname
|
||||
wget -q -O- http://169.254.169.254/latest/meta-data/public-hostname </dev/null >"$cache" 2>/dev/null &
|
||||
sleep $brief
|
||||
sleep 0.02
|
||||
[ -s "$cache" ] && read h < "$cache"
|
||||
else
|
||||
h=$(hostname -s 2>/dev/null || hostname)
|
||||
|
|
|
@ -209,7 +209,7 @@ metadata_available() {
|
|||
# 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
|
||||
# machines.
|
||||
local x=0 cache="$BYOBU_CONFIG_DIR/.metadata_available" brief="0.02"
|
||||
local x=0 cache="$BYOBU_CONFIG_DIR/.metadata_available"
|
||||
# First, check the cache
|
||||
if [ -s "$cache" ]; then
|
||||
# Metadata is non-empty, so we have metadata available
|
||||
|
@ -219,7 +219,7 @@ metadata_available() {
|
|||
if [ -e /etc/ec2_version ] || [ -e /usr/sbin/update-grub-legacy-ec2 ]; then
|
||||
# This *looks* like a machine with metadata, so background a potentially slow check
|
||||
wget -q -O- --timeout=10 --tries=1 http://169.254.169.254 </dev/null >"$cache" 2>/dev/null &
|
||||
sleep $brief
|
||||
sleep 0.02
|
||||
[ -s "$cache" ] && x=1
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -28,7 +28,7 @@ __ip_address_detail() {
|
|||
}
|
||||
|
||||
__ip_address() {
|
||||
local interface ipaddr cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/ip_address" brief="0.02"
|
||||
local interface ipaddr cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/ip_address"
|
||||
# Allow interface overrides in $BYOBU_CONFIG_DIR/statusrc
|
||||
if [ -n "$MONITORED_NETWORK" ]; then
|
||||
interface="$MONITORED_NETWORK"
|
||||
|
@ -43,7 +43,7 @@ __ip_address() {
|
|||
if [ "$IP_EXTERNAL" = "1" ]; then
|
||||
# Background an update
|
||||
wget -q -O- http://v6.ipv6-test.com/api/myip.php </dev/null >"$cache" 2>/dev/null &
|
||||
sleep $brief
|
||||
sleep 0.02
|
||||
else
|
||||
# Background an update
|
||||
if [ -x /sbin/ip ]; then
|
||||
|
@ -62,12 +62,12 @@ __ip_address() {
|
|||
*)
|
||||
if [ "$IP_EXTERNAL" = "1" ]; then
|
||||
wget -q -O- http://v4.ipv6-test.com/api/myip.php </dev/null >"$cache" 2>/dev/null &
|
||||
sleep $brief
|
||||
sleep 0.02
|
||||
[ -s "$cache" ] && read ipaddr < "$cache"
|
||||
elif metadata_available; then
|
||||
# We're in EC2, so get our public IP address
|
||||
wget -q -O- http://169.254.169.254/latest/meta-data/public-ipv4 </dev/null >"$cache" 2>/dev/null &
|
||||
sleep $brief
|
||||
sleep 0.02
|
||||
[ -s "$cache" ] && read ipaddr < "$cache"
|
||||
else
|
||||
if [ -x /sbin/ip ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue