From d49917d67331495f5668ceeec3dc693356413fa9 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 3 Mar 2010 12:25:49 -0600 Subject: [PATCH] usr/bin/byobu: more completely support attaching to an existing ssh agent on first launch of byobu, LP: #528967 --- debian/changelog | 4 ++-- usr/bin/byobu | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index f58c7bc5..d400924d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,8 @@ byobu (2.60) unreleased; urgency=low usr/share/byobu/ec2/rates.us_va: LP: #531497 - update ec2 pricing model, allow for local overrides of prices via a sourced symlink or bespoke file in $HOME/.byobu/ec2_rates - * usr/bin/byobu: support attaching to an existing ssh agent on first - launch of byobu, LP: #528967 + * usr/bin/byobu: more completely support attaching to an existing ssh + agent on first launch of byobu, LP: #528967 [ Meethune Bhowmick ] * rpm/byobu.spec: specfile updated/modernized for current layout, LP: #526233 diff --git a/usr/bin/byobu b/usr/bin/byobu index 90df069a..dcf0e266 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -44,13 +44,14 @@ grep -qs "^[^#]" "$HOME/.$PKG/windows" && DEFAULT_WINDOW= || DEFAULT_WINDOW="mot # Check if our terminfo supports 256 colors [ -x /usr/bin/tput ] && [ $(/usr/bin/tput colors) -eq 256 ] && SCREEN_TERM="-T screen-256color" +# Create or update ssh-agent socket +if [ -S "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then + rm -f "$RUN/$PKG.ssh-agent" + ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent" +fi + # Now let's execute screen! if [ "$#" = "0" ]; then - # Create or update ssh-agent socket - if [ -S "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then - rm -f "$RUN/$PKG.ssh-agent" - ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent" - fi out=$(screen -wipe 2>/dev/null) || true if echo "$out" | grep -qsi "^No Sockets found in "; then # Start new session