#!/bin/sh
################################################################################
#                                                                              #
# Polish Kathi Team 2009                                                       #
#                                                                              #
# contact: http://pkt.cal.pl /                                                 #
#                                                                              #
################################################################################

. /var/config/symlink
. /var/config/language.conf

#-------------------------------------------------------------------------------
#language section
#-------------------------------------------------------------------------------

if [ $lang == pl ]; then

  info1="Blad - brak emu Camd3 !!!"
  info2="Camd3 startuje..."
  info3="Camd3 uruchomiony"

elif [ $lang == en ]; then

  info1="Error - Camd3 is missing !!!"
  info2="Camd3 is starting..."
  info3="Camd3 is running"

elif [ $lang == ar ]; then

  info1="مفقود Camd3 -- خطأ"
  info2="Camd3 يتم تشغيل"
  info3="يعمل Camd3"

elif [ $lang == fr ]; then

  info1="Error - Camd3 introuvable !!!"
  info2="execute Camd3..."
  info3="Camd3 est active"

elif [ $lang == de ]; then

  info1="Fehler - kein Camd3 !!!"
  info2="Camd3 startet..."
  info3="Camd3 gestartet"

elif [ $lang == it ]; then

  info1="Errore - Camd3 non trovato !!!"
  info2="Camd3 in avvio..."
  info3="Camd3 avviato"

elif [ $lang == es ]; then
  info1="Error - Camd3 no existe !!!"
  info2="Camd3 se esta arrancando..."
  info3="Camd3 esta activa"

fi

#-------------------------------------------------------------------------------
#script section        
#-------------------------------------------------------------------------------

if [ ! -s /var/emu/camd3 ] ; then
    echo $info1 
    echo ""
else
    $SYMLINK/emustop.sh
        
    echo $info2
    /var/emu/camd3 /var/keys/camd3.config >/dev/null &
    echo /var/etc/camd3 >/var/etc/active_cam
    echo emuname =camd3 > /var/etc/camd3
    echo emu=camd3 >/var/config/emu.conf
    echo $info3
fi

exit 0
