#!/bin/sh

# Se il gruppo keyman non esiste, allora crealo
if ! grep -q keyman /etc/group; then
        groupadd keyman
fi

run=`grep ". /etc/rc.d/rc.keyman" etc/rc.d/rc.local`
if [[ "${run}" == "" ]]; then
cat << EOF >> etc/rc.d/rc.local

#keyman
# To disable keyman, chmod rc.keyman to 644
if [ -x /etc/rc.d/rc.keyman ]; then
	sh /etc/rc.d/rc.keyman start
fi
EOF
fi

( echo -e "\E[0;32m+----------------------------------------------------------------------+\E[0;0m" )
( echo -e "\E[0;32m|  Done. It's needed to add your user account to < keyman > group... |\E[0;0m" )
( echo -e "\E[0;32m|                                                                      |\E[0;0m" )
( echo -e "\E[0;32m|  Save and restart all services  or restart your machine                         |\E[0;0m" )
( echo -e "\E[0;32m|                                                                      |\E[0;0m" )
( echo -e "\E[0;32m+--------------------------------------------------------------------- +\E[0;0m" )
