aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorFlorian La Roche <laroche@redhat.com>2002-07-10 09:58:45 +0000
committerFlorian La Roche <laroche@redhat.com>2002-07-10 09:58:45 +0000
commitbd8c5c09526a6a445a54a79164d4e845da425102 (patch)
tree8de2314af01fb50b61f41570880182f923fee7d1 /rc.d/init.d/functions
parent78fd012ed58636caa076fa35b50c1001bb211b14 (diff)
downloadinitscripts-bd8c5c09526a6a445a54a79164d4e845da425102.tar
initscripts-bd8c5c09526a6a445a54a79164d4e845da425102.tar.gz
initscripts-bd8c5c09526a6a445a54a79164d4e845da425102.tar.bz2
initscripts-bd8c5c09526a6a445a54a79164d4e845da425102.tar.xz
initscripts-bd8c5c09526a6a445a54a79164d4e845da425102.zip
- drastically reduce the number of consoletype invocations
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions23
1 files changed, 11 insertions, 12 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 1371f897..996203a2 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -22,18 +22,19 @@ export PATH
# Get a sane screen width
[ -z "${COLUMNS:-}" ] && COLUMNS=80
+[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="`/sbin/consoletype`"
+
if [ -f /etc/sysconfig/i18n -a -z "${NOLOCALE:-}" ] ; then
. /etc/sysconfig/i18n
- if [ "${LANG:-}" = "ja_JP.eucJP" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
- elif [ "${LANG:-}" = "ko_KR.eucKR" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
- elif [ "${LANG:-}" = "zh_CN.GB2312" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
- elif [ "${LANG:-}" = "zh_TW.Big5" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
+ if [ "$CONSOLETYPE" != "pty" ]; then
+ case "${LANG:-}" in
+ ja_JP.eucJP|ko_KR.eucKR|zh_CN.GB2312|zh_TW.Big5)
+ unset LANG;;
+ *)
+ export LANG
+ esac
else
- export LANG
+ export LANG
fi
fi
@@ -53,15 +54,13 @@ if [ -z "${BOOTUP:-}" ]; then
SETCOLOR_NORMAL="echo -en \\033[0;39m"
LOGLEVEL=1
fi
- if [ -x /sbin/consoletype ]; then
- if [ "`consoletype`" = "serial" ]; then
+ if [ "$CONSOLETYPE" = "serial" ]; then
BOOTUP=serial
MOVE_TO_COL=
SETCOLOR_SUCCESS=
SETCOLOR_FAILURE=
SETCOLOR_WARNING=
SETCOLOR_NORMAL=
- fi
fi
fi