changeset 573:1e1db18fb7fa

STUB: bin/setup-X.sh
author Jeff Hammel <k0scist@gmail.com>
date Thu, 16 Jan 2014 16:32:52 -0800
parents 980fd762e354
children 00f5e55cbce8
files bin/setup-X.sh
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bin/setup-X.sh	Thu Jan 16 15:32:55 2014 -0800
+++ b/bin/setup-X.sh	Thu Jan 16 16:32:52 2014 -0800
@@ -24,11 +24,15 @@
 # ssh-add
 if [[ `ssh-add -l` != *id_?sa* ]]
 then
- SSH_ASKPASS=/usr/bin/ksshaskpass
- if [[ -e $SSH_ASKPASS ]]
+ GUI_SSH_ASKPASS=/usr/bin/ksshaskpass
+ if [[ -e "${GUI_SSH_ASKPASS}" ]]
  then
-   SSH_ASKPASS=${SSH_ASKPASS} ssh-add
+   SSH_ASKPASS=${GUI_SSH_ASKPASS} ssh-add
+ elif [[ -z "$PS1" ]]
+             # http://www.cyberciti.biz/faq/linux-unix-bash-check-interactive-shell/
+
+   echo "not running ssh-add: PS1 not found"
  else
-   echo "not running ssh-add: ${SSH_ASKPASS} not found"
+   ssh-add # interactive terminal
  fi
 fi
\ No newline at end of file