Sophie

Sophie

distrib > Mandriva > 7.2 > i586 > media > main-src > by-pkgid > 126d8494b3c17f86003d23206e617e34 > files > 4

acon-1.0.4-2mdk.src.rpm

#!/bin/sh
#
# Load arabic console support
#
# chkconfig: 2345 99 06
# description: This package loads the arabic support for the Linux console \
#   allowing right-to-left display of Arabic/Farsi/Hebrew text

[ -f /usr/bin/acon ] || exit 0

# Source function library.
. /etc/rc.d/init.d/functions

# source i18n values, so acon knows which support (Arabic, Hebrew,...) to use
. /etc/sysconfig/i18n

[ -z "$LANG" -a -n "$LC_ALL" ] && LANG=$LC_ALL
[ -z "$LANG" -a -n "$LC_CTYPE" ] && LANG=$LC_CTYPE
[ -z "$LANG" -a -n "$LANGUAGE" ] && LANG=$LANGUAGE

case "$LANG" in
	ar*) LANG_NAME="Arabic";
	fa*) LANG_NAME="Farsi";;
	he*) LANG_NAME="Hebrew";;
	ps*) LANG_NAME="Pashto";;
	ur*) LANG_NAME="Urdu";;
	yi*) LANG_NAME="Yiddish";;
	*) LANG_NAME="Arabic";;
esac

[ -z "$HENDI_NUM" ] && HENDI_NUM="-hn"

case "$1" in
	start)
		echo -n "Loading $LANG_NAME console support: "
		/usr/bin/acon $HENDI_NUM -s 1 2 3 4 5 6 &
		ps auwx | grep /usr/bin/acon | grep -v grep >& /dev/null \
			&& success || failure
		;;
	stop)
		echo -n "Stopping $LANG_NAME console support: "
		killall acon && success || failure
		;;
	restart|reload)
		$0 stop
		$0 start
		;;
	status)
		status acon
		;;
	*)
		echo "Usage: acon {start|stop|restart|reload|status}"
		exit 1
esac

exit 0