]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - setsysfont
fix RC_LOGGING=no daemon --makepid --fork write proper pidfile
[projects/rc-scripts.git] / setsysfont
index e4547db3fb0865a9f5f985757125b5f959f2b924..e4f96ab064f0b1485e3c3987e64a89f54ace0b3f 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/sh
 #
-#      $Id$
 #
 
 [ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
@@ -8,13 +7,20 @@
 
 [ -n "$SYSFONT" ] && CONSOLEFONT="$SYSFONT"
 
-case "$LANG" in
-  *.utf8|*.UTF-8)
-       if [ -x /bin/unicode_start ] && /sbin/consoletype fg ; then
+
+charmap=
+# /usr might not be mounted
+if [ -x /usr/bin/locale ]; then
+       charmap=$(LANG="$LANG" locale charmap)
+fi
+
+if [ "$charmap" = "UTF-8" ]; then
+       if [ -x /bin/unicode_start ] && /sbin/consoletype fg; then
                exec unicode_start $CONSOLEFONT $CONSOLEMAP
        fi
-       ;;
-esac
+elif [ -x /bin/unicode_stop ] && /sbin/consoletype fg; then
+       unicode_stop
+fi
 
 # console-tools, obsolete part
 if [ -x /usr/bin/consolechars -o -x /bin/consolechars ]; then
@@ -30,8 +36,8 @@ elif [ -x /usr/bin/setfont -o -x /bin/setfont ]; then
                ARGS="-u $CONSOLESCREENFONTMAP"
        fi
        if [ -n "$CONSOLEMAP" ]; then
-               if [ ! -f /lib/kbd/consoletrans/$CONSOLEMAP_to_uni.trans ]; then
-                       CONSOLEMAP=$(echo "$CONSOLEMAP" | sed "s|iso0|8859-|g;s|iso|8859-|g")
+               if [ ! -f /lib/kbd/consoletrans/${CONSOLEMAP}_to_uni.trans ]; then
+                       CONSOLEMAP=$(echo "$CONSOLEMAP" | awk '{ gsub(/iso[0]?/,"8859-"); print $0; }')
                fi
                ARGS="$ARGS -m $CONSOLEMAP"
        fi
@@ -40,10 +46,6 @@ elif [ -x /usr/bin/setfont -o -x /bin/setfont ]; then
        else
                echo -ne "\033(K" 2>/dev/null > /proc/$$/fd/0
        fi
-else
-       echo "can't set font"
-       exit 1
 fi
 
-# This must be last line !
-# vi:syntax=sh
+exit 0
This page took 0.080651 seconds and 4 git commands to generate.