]> git.pld-linux.org Git - packages/console-tools.git/blobdiff - console.sh
- one subshell less; read i18n only if there's activity to be done
[packages/console-tools.git] / console.sh
index f00230bd7cf022841a729c3e6c603fcf498968b2..e018d5a3a4b11392b6fd16275e891a20045dcc03 100644 (file)
@@ -1,23 +1,28 @@
+if tty -s; then
+ case $TERM in
+  linux)
+       [ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
 
-case $(tty) in
-(/dev/tty[0-9]|/dev/tty[0-9][0-9])
-
-       if [ -f /etc/sysconfig/console ]
-       then
+       if [ -f /etc/sysconfig/console ]; then
                . /etc/sysconfig/console
-       
-               if [ "$CONSOLEMAP" != "" ]
-               then
+
+               case "$LANG" in
+                       *.utf8|*.UTF-8)
+                               [ -x /bin/unicode_start ] && /sbin/consoletype fg && /bin/unicode_start
+                       ;;
+               esac
+
+               if [ "$CONSOLEMAP" != "" ]; then
                        # Switch the G0 charset map from the default ISO-8859-1
                        # to the user-defined map (loaded with consolefonts)
-                       echo -ne '\33(K'
+                       if [ -w /proc/$$/fd/0 -a -t 0 ]; then
+                               echo -n -e '\033(K' > /proc/$$/fd/0
+                       else
+                               echo -n -e '\033(K' > /dev/tty
+                       fi
                fi
                
        fi
-        if dmesg|grep 'Console: mono' >/dev/null 2>&1
-       then
-               TERM=linux-m
-               export TERM
-       fi
        ;;
-esac
+ esac
+fi
This page took 0.066953 seconds and 4 git commands to generate.