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

. /var/config/language.conf

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

if [ $lang == pl ]; then

  info1="Newcs startuje..."
  info2="Newcs uruchomiony"
  info3="Brak pliku newcs.xml"

elif [ $lang == ar ]; then

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

elif [ $lang == en ]; then

  info1="Newcs is starting..."
  info2="Newcs is running"
  info3="newcs.xml is missing"

elif [ $lang == fr ]; then

  info1="execute Newcs..."
  info2="Newcs est active"
  info3="newcs.xml non existe"

elif [ $lang == de ]; then

  info1="Starte Newcs ..."
  info2="Newcs gestartet"
  info3="Newcs.xml fehlt"

elif [ $lang == it ]; then

  info1="Newcs in avvio..."
  info2="Newcs avviato"
  info3="newcs.xml non trovato"

elif [ $lang == es ]; then
  info1="Newcs se esta arrancando..."
  info2="Newcs esta activa"
  info3="newcs.xml no existe"
  
elif [ $lang == ar ]; then

  info1="Newcs تشغيل..."
  info2="Newcs is running"
  info3="newcs.xml is missing"  
     
fi

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

killall newcs >/dev/null
sleep 2
   if [ -s /var/keys/newcs.xml ] ; then
      echo $info1
      /var/bin/newcs -C /var/keys/newcs.xml >/tmp/log_newcs &
      sleep 2
      echo $info2
   else
      echo $info3
   fi

exit 0