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

. /var/config/link
. /var/config/newcs.conf
. /var/config/language.conf

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

if [ $lang == pl ]; then

  info1="Zatrzymanie dzialajacego newcs"
  info2="Kasowanie newcs"
  info3="newcs usuniety!"
  info4="Brak zainstalowanego newcs"

elif [ $lang == en ]; then

  info1="newcs is stopping"
  info2="Deleting newcs"
  info3="newcs deleted!"
  info4="newcs is not installed"     

elif [ $lang == ar ]; then

  info1="newcs إيقاف"
  info2="newcs حذف"
  info3="newcs تم حذف"
  info4="newcs لم يتم تنصيب"

elif [ $lang == fr ]; then

  info1="newcs s'arrete"
  info2="Suppression newcs"
  info3="newcs supprime!"
  info4="newcs n'est pas installe"
  
elif [ $lang == de ]; then

  info1="Stoppe newcs"
  info2="Losche newcs"
  info3="Newcs geloscht!"
  info4="Kein Newcs"

elif [ $lang == it ]; then

  info1="Newcs e' in arresto"
  info2="Eliminazione Newcs ..."
  info3="Newcs eliminato!"
  info4="Newcs non installato"

elif [ $lang == es ]; then
  info1="newcs se esta parando"
  info2="Borrando newcs"
  info3="newcs borrada!"
  info4="newcs no esta instalada"   

fi

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

 if [ $newcs == on ]; then
    echo $info1
    killall -15 newcs 2>/dev/null
    sleep 3
 fi

 if [ -s /var/bin/newcs ] ; then
    echo $info2
    rm /var/bin/newcs 2>/dev/null
    sleep 3
    echo $info3
 else
    echo $info4
 fi
 
echo ""
 
exit 0