aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--initscripts.spec1
-rwxr-xr-xrc.d/init.d/functions23
2 files changed, 12 insertions, 12 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 6103a611..199f0e0e 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -250,6 +250,7 @@ rm -rf $RPM_BUILD_ROOT
- allow building with a cross-compiler #64362,#64255
- faster check in network-functions:check_default_route()
- better checks for backup files
+- drastically reduce the number of consoletype invocations
* Fri Jul 05 2002 Florian La Roche <Florian.LaRoche@redhat.de>
- rc.sysinit: do not load raid modules unless /etc/raidtab exists
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