#!/bin/sh

set -e

test -f /usr/bin/cyr || exit 0

case "$1" in
    stop)
	# console-cyrillic isn't a daemon
	;;
    start|force-reload|restart|reload)
	if [ -f /etc/console-cyrillic ]; then
	    if ! grep -i '^ *# *bootsetup: *no' /etc/console-cyrillic >/dev/null; then
		echo -n "Setting up Cyrillic on the console... "
		cyr
		echo "done."
	    fi
	fi
	;;
    *)
	echo 'Usage: /etc/init.d/console-cyrillic {start|reload|restart|force-reload|stop}'
	exit 1
	;;
esac
