From 10c940961d293df41967a09e5a8c326beaa94afd Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 3 May 2012 15:08:55 +0100 Subject: [PATCH] Use bash builtin to check for tty. --- .profile.d/krb5.bashrc | 2 +- .profile.d/ssh.bashrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile.d/krb5.bashrc b/.profile.d/krb5.bashrc index 034dadd..4c5f71d 100644 --- a/.profile.d/krb5.bashrc +++ b/.profile.d/krb5.bashrc @@ -3,7 +3,7 @@ alias pssh='ssh -o preferredauthentications=password,keyboard-interactive' unalias kinit 2>/dev/null if [ 1 = 0 -a -z "$OLDSOLARIS" -a -z "$OLDREDHAT" ]; then - if tty -s; then + if [ -t 0 ]; then if [ ! "$SUDO_UID" ]; then if klist -s 2>/dev/null; then # We already have a ticket cache. Renew it. diff --git a/.profile.d/ssh.bashrc b/.profile.d/ssh.bashrc index 0bb5011..65d117d 100644 --- a/.profile.d/ssh.bashrc +++ b/.profile.d/ssh.bashrc @@ -6,7 +6,7 @@ if [ $UID -gt 0 ]; then while read allowed; do if [ "${HOSTNAME%%.*}" = "$allowed" ]; then eval $(keychain -q --timeout 7200 --agents ssh --eval) - if tty -s; then + if [ -t 0 ]; then ssh-add -l >/dev/null || ssh-add fi fi -- 2.20.1