From f27b9adb57c38b296add2f5ee8bfed47cfdd013a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 18 Aug 2010 15:28:56 +0200 Subject: functions: check type of stdout/stderr instead of stdin --- rc.d/init.d/functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'rc.d/init.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 15fc6415..3ce93ecf 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -16,7 +16,9 @@ export PATH # Get a sane screen width [ -z "${COLUMNS:-}" ] && COLUMNS=80 -[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype)" +# /sbin/consoletype checks the type of stdin. Since we are mostly +# interested in output, we use redirection to check stdout/stderr instead. +[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype < /dev/stderr)" if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && [ -f /etc/sysconfig/i18n ] ; then . /etc/profile.d/lang.sh 2>/dev/null -- cgit v1.2.1