1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#!/bin/sh
#
# Tue Nov 7 2000 Go Taniguchi <go@turbolinux.co.jp>
# Fri Feb 23 2001 Merlin Ma <merlin@turbolinux.com.cn>
#
function modinstall
{
/sbin/modprobe $1
if [ ! "$?" = "0" ]; then
echo Install driver $1 error.
exit 3
fi
}
if [ ! "$DISPLAY" = "" ] ; then
echo Can not run unicon under X.
exit 1
fi
if [ ! "$UID" = "0" ] ; then
echo Can not install unicon drivers with non root user.
exit 2
fi
if [ ! "$LC_ALL" = "" ] ; then
UNICONLANG=$LC_ALL
elif [ ! "$LANG" == "" ] ; then
UNICONLANG=$LANG
elif [ -e /etc/sysconfig/i18n ] ; then
if grep -q GB18030 /etc/sysconfig/i18n ; then
UNICONLANG=GBK
elif grep -q GBK /etc/sysconfig/i18n ; then
UNICONLANG=GBK
elif grep -q GB /etc/sysconfig/i18n ; then
UNICONLANG=GB2312
elif grep -q TW /etc/sysconfig/i18n ; then
UNICONLANG=BIG5
elif grep -q ja /etc/sysconfig/i18n ; then
UNICONLANG=JP
elif grep -q ko /etc/sysconfig/i18n ; then
UNICONLANG=KR
else
UNICONLANG=GBK
fi
fi
if ! grep -q '[[:alnum:]]' /proc/fb ; then
modinstall vga16fb
fi
modinstall unikey
loadunimap /usr/lib/unicon/direct.uni
case $UNICONLANG in
zh_CN.GB2312|GBK)
modinstall encode-gbk
unicon --gbk
;;
zh_CN.GBK|GBK)
modinstall encode-gbk
unicon --gbk
;;
zh_CN.GB2312|GB2312)
modinstall encode-gb
unicon --gb
;;
zh_TW.Big5|BIG5)
modinstall encode-big5
unicon --big5
;;
ja*|JP)
modinstall encode-jis
unicon --jis
;;
ko*|KR)
modinstall encode-kscm
unicon --kscm
;;
*)
modinstall encode-gbk
unicon --gbk
esac
if [ -f /var/lock/subsys/gpm ] ; then
/etc/rc.d/init.d/gpm restart 1>/dev/null 2>/dev/null
fi
exit 0
|